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 eli.bendersky
Recipients docs@python, eli.bendersky, ezio.melotti, pitrou
Date 2011-09-01.05:17:07
SpamBayes Score 3.0789342e-06
Marked as misclassified No
Message-id <1314854228.49.0.163476055978.issue12875@psf.upfronthosting.co.za>
In-reply-to
Content
In the 2.7 docs, re.compile has this signature:

  re.compile(pattern[, flags])

From here it isn't clear what the default value of 'flags' is, to be able to write code like this:

  re.compile(pattern, re.I if options['ignore_case'] else <WHAT??>)

Of course, looking at the source shows immediately that the default flag value is 0 (which is kind-of implied by the flags being a bit-OR of flags, but not mentioned explicitly).

I saw that in the latest 3K docs, it is documented properly:

  re.compile(pattern, flags=0)

Naturally this applies to other methods of 're' that take 'flags'.

I hope I'm not missing something and this really is just a documentation issue. If no objections arise, I will commit a fix to the docs of 're' in 2.7
History
Date User Action Args
2011-09-01 05:17:08eli.benderskysetrecipients: + eli.bendersky, pitrou, ezio.melotti, docs@python
2011-09-01 05:17:08eli.benderskysetmessageid: <1314854228.49.0.163476055978.issue12875@psf.upfronthosting.co.za>
2011-09-01 05:17:07eli.benderskylinkissue12875 messages
2011-09-01 05:17:07eli.benderskycreate