[Python-bugs-list] [ python-Bugs-597177 ] Tiny tiny doc bug in regexp lib

noreply@sourceforge.net noreply@sourceforge.net
Tue, 20 Aug 2002 07:00:42 -0700


Bugs item #597177, was opened at 2002-08-19 10:27
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=597177&group_id=5470

Category: Documentation
Group: Python 2.2.1
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Andrew Koenig (arkoenig)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: Tiny tiny doc bug in regexp lib

Initial Comment:
Section 4.2.4, in the description of "match", says:

The optional parameter endpos limits how far the string
will be searched; it will be as if the string is endpos
characters long, so only the characters from pos to
endpos will be searched for a match.

Shouldn't it be "as if the string is endpos-pos
characters long"?  Also, shouldn't it be "the
characters in the range [pos:endpos]" to avoid the
potential ambiguity (i.e. making it clearer that the
range does not include the character at index endpos)?

Finally, what happens if pos > endpos?


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

>Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2002-08-20 10:00

Message:
Logged In: YES 
user_id=3066

I've made some clarifications, but perhaps not what Andrew
expected.  The behavior of endpos < pos is now described
explicitly.

Committed as Doc/lib/libre.tex revisions 1.86 and 1.73.6.9.

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

Comment By: Raymond Hettinger (rhettinger)
Date: 2002-08-19 19:18

Message:
Logged In: YES 
user_id=80475

The suggestion of using "range[pos:endpos]" would be an 
improvement, but it suggests a contradiction to the 
preceding statement that the pos and endpos are not 
completely equivalent to string slicing.

IMHO, the docs are clearer as-is.


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

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