Message182874
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'. |
|
Date |
User |
Action |
Args |
2013-02-24 12:49:20 | elazar | set | recipients:
+ elazar |
2013-02-24 12:49:20 | elazar | set | messageid: <1361710160.02.0.405810839131.issue17287@psf.upfronthosting.co.za> |
2013-02-24 12:49:19 | elazar | link | issue17287 messages |
2013-02-24 12:49:19 | elazar | create | |
|