-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Get rid of VerEx() and "from" import #23
Comments
The I agree lowercase format would look more pythonic. |
On the other hand, you could see verbalexpressions as a "regular expression builder", and thus imitating a string builder. In this case the Python implementation should be something like: ve = new VerEx()
ve.first('http://')
ve.maybe('www.')
ve.then('google.com') ...like compared to e.g. Java's StringBuilder |
Maybe it's just me, but I find the string building way very unpythonic. It just makes sense to have this instead:
Yes, it's longer, but also more clear and explicit. This is also how SQLAlchemy works -- a very similar library but for building SQL instead of regex. Also, not supporting the string builder would allow something like this:
With the string building example of yours, |
I personally dislike the current behavior of:
As opposed to an arguably more Pythonic way:
I would like to contribute and implement the functionality in question, but I need to know first that it would be a welcome change -- else I'd be just wasting everyone's time.
What do you guys think, would it be cleaner to implement it to support module scope function calls? Obviously each call to these module scope functions would still create a new
VerEx
object internally.The text was updated successfully, but these errors were encountered: