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 mrabarnett
Recipients dwt, ezio.melotti, mrabarnett, pitrou, rhettinger
Date 2011-12-13.21:24:19
SpamBayes Score 0.000325372
Marked as misclassified No
Message-id <>
Actually, one possibility that occurs to me is to provide the flags within the pattern. The .pattern attribute gives the original pattern, but repr could give the flags in-line at the start of the pattern:

>>> # Assuming Python 3.
>>> r = re.compile("a", re.I)
>>> r.flags
>>> r.pattern
>>> repr(r)
"<_sre.SRE_Pattern '(?i)a'>"

I'm not sure how to make it eval-able, unless you mean something more like:

>>> repr(r)

where re.Regex == re.compile, which would be more meaningful than:

>>> repr(r)
Date User Action Args
2011-12-13 21:24:20mrabarnettsetrecipients: + mrabarnett, rhettinger, pitrou, ezio.melotti, dwt
2011-12-13 21:24:20mrabarnettsetmessageid: <>
2011-12-13 21:24:20mrabarnettlinkissue13592 messages
2011-12-13 21:24:19mrabarnettcreate