Message143300
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 |
|
Date |
User |
Action |
Args |
2011-09-01 05:17:08 | eli.bendersky | set | recipients:
+ eli.bendersky, pitrou, ezio.melotti, docs@python |
2011-09-01 05:17:08 | eli.bendersky | set | messageid: <1314854228.49.0.163476055978.issue12875@psf.upfronthosting.co.za> |
2011-09-01 05:17:07 | eli.bendersky | link | issue12875 messages |
2011-09-01 05:17:07 | eli.bendersky | create | |
|