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

Easier custom regex flags and tests #6

Merged
merged 4 commits into from
Nov 22, 2015

Conversation

aolieman
Copy link
Contributor

This adds tests for the use of custom regex flags. While writing the tests, I encountered some problems monkeypatching the config neatly, so I refactored this mechanism.

The tests also uncovered that the type check in Expression.findall() was problematic for cross-version compatibility. This could be overcome by using past.builtins.basestring, which unfortunately is not compatible with py3.2. Due to the lack of unicode string marker support in py>=3.0,<3.3, it seems practically impossible to maintain support for these versions while allowing custom regex flags.

@andychase
Copy link
Owner

This look good, I'll merge this.

I'm going to do a rebase though afterward-- instead of loosing python 3.2 support I'm go to rebase this to detect strings with:

if hasattr(match, 'strip'):

Instead of

if isinstance(match, basestring):

The former keeps Python 3.2 support and doesn't require an extra library.

andychase added a commit that referenced this pull request Nov 22, 2015
Easier custom regex flags and tests
@andychase andychase merged commit ecfd6ad into andychase:develop Nov 22, 2015
@aolieman
Copy link
Contributor Author

Alright, good catch! Any idea as to when the new release will show up on PyPI?

@andychase
Copy link
Owner

I did a final review of all the code, added some notes and released just now!

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

Successfully merging this pull request may close these issues.

2 participants