[ python-Bugs-1631394 ] sre module has misleading docs

SourceForge.net noreply at sourceforge.net
Tue Mar 6 21:55:23 CET 2007


Bugs item #1631394, was opened at 2007-01-09 12:12
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1631394&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
>Category: Regular Expressions
>Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Tom Lynn (tlynn)
>Assigned to: Fredrik Lundh (effbot)
Summary: sre module has misleading docs

Initial Comment:
>>> help(sre)
...
   "$"      Matches the end of the string.
...
   \Z       Matches only at the end of the string.
...
M  MULTILINE   "^" matches the beginning of lines as well as the string.
               "$" matches the end of lines as well as the string.

The docs for "$" are misleading - it actually matches in newline-specific ways which the module's built-in docs don't hint at.  The MULTILINE docs don't clarify this.

I'd also like to see "from sre import __doc__" added to the end of re.py; lack of "help(re)" is a bigger problem than having slightly wrong auto-generated docs for the re module itself.


----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2007-03-06 21:55

Message:
Logged In: YES 
user_id=21627
Originator: NO

The re.__doc__ problem is gone; the problem that the $ documentation
doesn't give a complete specification persists.

Fredrik, do you have an opinion on this? If not, please unassign.

----------------------------------------------------------------------

Comment By: Georg Brandl (gbrandl)
Date: 2007-03-06 19:34

Message:
Logged In: YES 
user_id=849994
Originator: NO

Doesn't seem so. Note that the sre.__doc__ problem doesn't exist in 2.5
anymore since re is now what sre was before.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2007-01-09 19:22

Message:
Logged In: YES 
user_id=21627
Originator: NO

Did you mean to include a patch?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1631394&group_id=5470


More information about the Python-bugs-list mailing list