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 <1479460516.78.0.897563730332.issue28727@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2016-11-18 09:15:16vstinnersetrecipients: + vstinner, ezio.melotti, mrabarnett, SilentGhost, serhiy.storchaka
2016-11-18 09:15:16vstinnersetmessageid: <1479460516.78.0.897563730332.issue28727@psf.upfronthosting.co.za>
2016-11-18 09:15:16vstinnerlinkissue28727 messages
2016-11-18 09:15:16vstinnercreate