Message281087
Serhiy: "There is a problem with locale-depending flags. The same pattern may be compiled with the LOCALE flag to different pattern objects in different locales."
Oh, I didn't know and you are right.
"Perhaps we should compare the compiled code instead of pattern strings. Or both."
PatternObject contains many fields. I used the following two fields which come from re.compile():
* pattern
* flags
I considered that they were enough because pattern_repr() only displays these ones. Other fields:
* groups
* groupindex
* indexgroup
* weakreflist
* isbytes
* codesize, code
weakreflist can be skipped, isbytes is already tested in my patch.
Would it be possible to only compare code instead of pattern? What are groups, groupindex and indexgroup: should we also compare them?
Maybe I can start from pattern_compare-4.patch and only add a test comparing code? |
|
Date |
User |
Action |
Args |
2016-11-18 09:15:16 | vstinner | set | recipients:
+ vstinner, ezio.melotti, mrabarnett, SilentGhost, serhiy.storchaka |
2016-11-18 09:15:16 | vstinner | set | messageid: <1479460516.78.0.897563730332.issue28727@psf.upfronthosting.co.za> |
2016-11-18 09:15:16 | vstinner | link | issue28727 messages |
2016-11-18 09:15:16 | vstinner | create | |
|