This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients SilentGhost, ezio.melotti, mrabarnett, serhiy.storchaka, vstinner
Date 2016-11-18.09:15:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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:16vstinnersetrecipients: + vstinner, ezio.melotti, mrabarnett, SilentGhost, serhiy.storchaka
2016-11-18 09:15:16vstinnersetmessageid: <>
2016-11-18 09:15:16vstinnerlinkissue28727 messages
2016-11-18 09:15:16vstinnercreate