[Patches] [ python-Patches-760792 ] "wo" in "word" now valid but not documented as such

SourceForge.net noreply@sourceforge.net
Thu, 26 Jun 2003 12:33:23 -0700


Patches item #760792, was opened at 2003-06-25 16:35
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=760792&group_id=5470

Category: Documentation
Group: Python 2.3
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Gerrit Holl (gerrit)
Assigned to: Nobody/Anonymous (nobody)
Summary: "wo" in "word" now valid but not documented as such

Initial Comment:
http://www.python.org/dev/doc/devel/ref/comparisons.html
states:

"""For the Unicode and string types, x in y is true if
and only if there exists an index i such that x == y[i]
is true. If x is not a string or Unicode object of
length 1, a TypeError exception is raised."""

However, as of Python 2.3, this is no longer True, as
stated in
http://www.python.org/doc/2.3b1/whatsnew/node17.html#SECTION0001710000000000000000:

"""The in operator now works differently for strings.
Previously, when evaluating X in Y where X and Y are
strings, X could only be a single character. That's now
changed; X can be a string of any length, and X in Y
will return True if X is a substring of Y. If X is the
empty string, the result is always True."""

This patch fixes the reference documentation.



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

>Comment By: Raymond Hettinger (rhettinger)
Date: 2003-06-26 14:33

Message:
Logged In: YES 
user_id=80475

Revised wording and applied as Doc/ref/ref5.tex 1.75


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

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