Issue 1546585: String methods don't support explicit None arguments (original) (raw)
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).