Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > re documentation bug?

Thread Tools

re documentation bug?

Tycho Andersen
Posts: n/a
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.
>>> import re
>>> p = re.compile("foo")
>>> re.sub(p, "bar", "foobaz", flags=re.IGNORECASE)

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?


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
converting XSD documentation to HTML documentation XML 1 09-16-2006 12:09 PM
Windows Server 2003 Documentation Survival Guide James McIllece [MS] Wireless Networking 0 01-20-2005 07:58 PM
Wireless Provisioning Services (WPS) documentation now available Bryan S. Burgin [MSFT] Wireless Networking 0 08-19-2004 03:31 AM
Python documentation: How about structured documentation? Looking for comments/suggestions Kenneth McDonald Python 2 05-06-2004 04:11 AM
Principles of documentation (was: Python Documentation Blows!) Cameron Laird Python 1 04-03-2004 06:54 PM