Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

Scott David Daniels Scott.Daniels at Acm.Org
Sat Sep 3 16:52:50 CEST 2005


Bengt Richter wrote:
> On Wed, 31 Aug 2005 14:16:28 GMT, Ron Adam <rrr at ronadam.com> wrote:
> [...]
> 
>>The problem with negative index's are that positive index's are zero 
>>based, but negative index's are 1 based.  Which leads to a non 
>>symmetrical situations.
Although it is _way_ too late to try something like this, once upon
a time you could have done all of this using the one's complement
operator:
     ~0  does exist and is distinct from 0.
So you could talk about a slice:
     str[4 : ~2]
and so on.

--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list