[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

STINNER Victor report at bugs.python.org
Mon Nov 21 09:43:15 EST 2016


STINNER Victor added the comment:

Back to basis, patch 6:

* revert changes on indexgroup and groupindex types: I will fix this later, once this issue is fixed
* pattern_richcompare() and pattern_hash() also uses pattern, but don't use groups, indexgroup nor groupindex anymore

I removed the @cpython_only unit test and rewrote test_pattern_compare_bytes() to make it easier to follow.

re.compile('abc', re.IGNORECASE) is different than re.compile('ABC', re.IGNORECASE), but it's a deliberate choice to not test it. I consider that the behaviour can change depending on the Python implementation and in a future version.

----------
Added file: http://bugs.python.org/file45587/pattern_compare-6.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28727>
_______________________________________


More information about the Python-bugs-list mailing list