Message133527
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 |
|
Date |
User |
Action |
Args |
2011-04-11 15:09:08 | hkBst | set | recipients:
+ hkBst |
2011-04-11 15:09:08 | hkBst | set | messageid: <1302534548.79.0.822537376297.issue11828@psf.upfronthosting.co.za> |
2011-04-11 15:09:08 | hkBst | link | issue11828 messages |
2011-04-11 15:09:08 | hkBst | create | |
|