This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author elazar
Recipients elazar
Date 2013-02-24.12:49:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1361710160.02.0.405810839131.issue17287@psf.upfronthosting.co.za>
In-reply-to
Content
slice behavior is not consistent for negative lower or upper arguments, which could be surprising:

>>> 'hello'[:-2]
'hel'
>>> 'hello'[:-1]
'hell'
>>> 'hello'[:-0]
''

this is obvious when written as literal, but not so obvious when using variables in expressions like 'fullname[:-len(lastname)]'. same goes for 'lower'.
History
Date User Action Args
2013-02-24 12:49:20elazarsetrecipients: + elazar
2013-02-24 12:49:20elazarsetmessageid: <1361710160.02.0.405810839131.issue17287@psf.upfronthosting.co.za>
2013-02-24 12:49:19elazarlinkissue17287 messages
2013-02-24 12:49:19elazarcreate