Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empty string results in object names being assigned #21

Open
davemcphee opened this issue Nov 23, 2015 · 2 comments
Open

empty string results in object names being assigned #21

davemcphee opened this issue Nov 23, 2015 · 2 comments

Comments

@davemcphee
Copy link

test = CommonRegex('')
test.dates
<function regex.call..regex_method at 0x000000000389F048>
test.dates()
[]
test = CommonRegex('asdasd')
test.dates
[]
test.dates()
Traceback (most recent call last):
File "", line 1, in
TypeError: 'list' object is not callable

This is on python 3.3.3 on Win 7 x64bit

I won't be surprised if this if my failure to understand a concept :)
Obvious workaround to detect empty strings before passing to CommonRegex is obvious.

@bootandy
Copy link

bootandy commented Feb 9, 2016

You want to use test.dates not test.dates()

@madisonmay
Copy link
Owner

I think a better option is to ensure a string is input, rather than checking the truthiness of the input text to decide whether to continue.

ayush268 added a commit to ayush268/CommonRegex that referenced this issue Mar 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants