Message281046
Attached patch implements rich comparison for _sre.SRE_Pattern objects created by re.compile().
Comparison between patterns is used in the warnings module to not add duplicated filters, see issue #18383:
New changeset f57f4e33ba5e by Martin Panter in branch '3.5':
Issue #18383: Avoid adding duplicate filters when warnings is reloaded
https://hg.python.org/cpython/rev/f57f4e33ba5e
For the warnings module, it became a problem in test_warnings since the Python test runner started to clear all caches. When re.purge() is called, re.compile() creates a new object, whereas with the cache it returns the same object and so the two patterns are equal since it's the same object. => see issue #28688 |
|
Date |
User |
Action |
Args |
2016-11-17 16:02:48 | vstinner | set | recipients:
+ vstinner |
2016-11-17 16:02:48 | vstinner | set | messageid: <1479398568.09.0.867806263276.issue28727@psf.upfronthosting.co.za> |
2016-11-17 16:02:48 | vstinner | link | issue28727 messages |
2016-11-17 16:02:47 | vstinner | create | |
|