[Python-checkins] python/nondist/peps pep-0008.txt, 1.19,
1.20 pep-0290.txt, 1.9, 1.10
rhettinger at users.sourceforge.net
rhettinger at users.sourceforge.net
Fri Sep 26 22:54:01 EDT 2003
Update of /cvsroot/python/python/nondist/peps
In directory sc8-pr-cvs1:/tmp/cvs-serv4933
Modified Files:
pep-0008.txt pep-0290.txt
Log Message:
* str.startwith() is less errorprone that slice comparisons but not as fast.
* Fix minor typos.
Index: pep-0008.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0008.txt,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** pep-0008.txt 22 Sep 2003 04:51:49 -0000 1.19
--- pep-0008.txt 27 Sep 2003 02:53:59 -0000 1.20
***************
*** 547,552 ****
- Avoid slicing strings when checking for prefixes or suffixes.
! Use startswith() and endswith() instead, since they are faster,
! cleaner and less error prone. E.g.:
No: if foo[:3] == 'bar':
--- 547,552 ----
- Avoid slicing strings when checking for prefixes or suffixes.
! Use startswith() and endswith() instead, since they are
! cleaner and less error prone. For example:
No: if foo[:3] == 'bar':
Index: pep-0290.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0290.txt,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** pep-0290.txt 7 Mar 2003 00:21:42 -0000 1.9
--- pep-0290.txt 27 Sep 2003 02:53:59 -0000 1.10
***************
*** 121,125 ****
In Python 2.3, apply() was marked for Pending Deprecation because it
! was made obsolete by the Python 1.6's introduction of * and ** in
function calls. Using a direct function call was always a little
faster than apply() because it saved the lookup for the builtin.
--- 121,125 ----
In Python 2.3, apply() was marked for Pending Deprecation because it
! was made obsolete by Python 1.6's introduction of * and ** in
function calls. Using a direct function call was always a little
faster than apply() because it saved the lookup for the builtin.
***************
*** 128,132 ****
Pattern::
! apply(f,args, kwds) --> f(*args, **kwds)
--- 128,132 ----
Pattern::
! apply(f, args, kwds) --> f(*args, **kwds)
***************
*** 278,283 ****
''''''''''''''''''''''''''''''''''''''''''''''
! Use these string methods instead of slicing. They're faster because
! no slice has to be created, and there's no risk of miscounting.
Pattern::
--- 278,283 ----
''''''''''''''''''''''''''''''''''''''''''''''
! Use these string methods instead of slicing. No slice has to be
! created and there's no risk of miscounting.
Pattern::
More information about the Python-checkins
mailing list