Message29684
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). |
|
Date |
User |
Action |
Args |
2007-08-23 14:42:22 | admin | link | issue1546585 messages |
2007-08-23 14:42:22 | admin | create | |
|