New submission from Marijn Schouten <hk...@gentoo.org>:

startswith and endswith don't accept None as slice index, as shown by below 
interaction. Same behavior for python-3.1.3(with print()) and python-2.7.1. If 
instead this is intended behavior then the error message is wrong.

$ python -c "print 'abc'[-1:None]"
c
$ python -c "print 'abc'.endswith('c',-1,None)"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: slice indices must be integers or None or have an __index__ method

----------
components: None
messages: 133527
nosy: hkBst
priority: normal
severity: normal
status: open
title: startswith and endswith don't accept None as slice index
type: behavior
versions: Python 2.7, Python 3.1

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11828>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to