Issue1546585
Created on 2006-08-25 11:39 by ncoghlan, last changed 2007-12-03 13:15 by ncoghlan.
|
msg29684 - (view) |
Author: Nick Coghlan (ncoghlan) |
Date: 2006-08-25 11:39 |
|
Unlike normal slicing, string methods do not currently
support passing an explicit None argument (you either
have to omit the arguments, or pass an actual integer
or object with an __index__ method).
This was the case in previous Python versions, so no
existing code is going to break.
However these methods issue the same TypeError message
as normal slicing which now explicitly lists None as an
acceptable value, which is confusing as all heck when
the call that breaks is "s.index(sub, start, stop)"m
and printing out start and stop shows them both to be None.
Given that the string docs say things like (from
str.count) "Optional arguments start and end are
interpreted as in slice notation", I think this should
be fixed (which is why I put it on the bug tracker for
2.5, not the RFE one for 2.6).
|
|
msg58122 - (view) |
Author: Nick Coghlan (ncoghlan) |
Date: 2007-12-03 13:15 |
|
This has been implemented for 2.6
|
|
| Date |
User |
Action |
Args |
| 2007-12-03 13:15:18 | ncoghlan | set | status: open -> closed versions:
+ Python 2.6, - Python 2.5 type: feature request messages:
+ msg58122 priority: high -> normal resolution: later -> fixed |
| 2006-08-25 11:39:10 | ncoghlan | create | |
|