re documentation bug?

T

Tycho Andersen

Consider the following session:

Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: sub() got an unexpected keyword argument 'flags'

The flags should really be passed to re.compile() instead. However,
the documentation indicates that they can be passed to re.sub() as
well. Is this a bug, or am I reading things wrong?

http://docs.python.org/library/re.html#re.sub

TIA!

\t
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,961
Messages
2,570,131
Members
46,689
Latest member
liammiller

Latest Threads

Top