Mailing List Archive

python/nondist/peps pep-0290.txt,1.2,1.3
Update of /cvsroot/python/python/nondist/peps
In directory usw-pr-cvs1:/tmp/cvs-serv13119

Modified Files:
pep-0290.txt
Log Message:
Added a recommendation to use s2 in s1 for Python 2.3 and later.


Index: pep-0290.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0290.txt,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** pep-0290.txt 30 Jun 2002 23:02:23 -0000 1.2
--- pep-0290.txt 12 Aug 2002 14:22:33 -0000 1.3
***************
*** 154,157 ****
--- 154,168 ----


+ Pattern: "s1".find("s2") >= 0 or "s1".find("s2") != -1 -> "s2" in "s1"
+ Idea: In Python 2.3, for "s2" in "s1", the length
+ restriction on s2 are lifted; they can now be strings
+ of any length.
+ Version: 2.3 or later
+ Benefits: When searching for a substring, where you don't care
+ about the position of the substring in the original
+ string, using the `in' operator makes things more
+ clear.
+
+
References