[issue11828] startswith and endswith don't accept None as slice index

Guido van Rossum report at bugs.python.org
Tue Nov 8 09:43:09 CET 2011


Guido van Rossum <guido at python.org> added the comment:

As I wrote in python-dev:

I agree with Raymond that this should be treated as a feature request and not "fixed" in 2.7 / 3.2. (However the mention of 'find' in the error message for 'index' is a bug and should be fixed.)

As for the feature request, I think that allowing None in more places is more regular and consistent across interfaces. I note that the slice() object also represents "missing" or "default" values as None, so it is not just a carryover from the old string.py.

So, +1 on the feature for 3.3; -1 on the "fix" in 3.2 or 2.7.

----------
nosy: +gvanrossum

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11828>
_______________________________________


More information about the Python-bugs-list mailing list