[docs] [issue12875] backport re.compile flags default value documentation

Eli Bendersky report at bugs.python.org
Thu Sep 1 07:17:08 CEST 2011


New submission from Eli Bendersky <eliben at gmail.com>:

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

----------
assignee: docs at python
components: Documentation
messages: 143300
nosy: docs at python, eli.bendersky, ezio.melotti, pitrou
priority: normal
severity: normal
status: open
title: backport re.compile flags default value documentation
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12875>
_______________________________________


More information about the docs mailing list