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

Antoon Pardon apardon at forel.vub.ac.be
Tue Aug 30 06:07:06 EDT 2005


Op 2005-08-30, Terry Reedy schreef <tjreedy at udel.edu>:
>
> "Paul Rubin" <"http://phr.cx"@NOSPAM.invalid> wrote in message 
> news:7xy86k3r7n.fsf at ruckus.brouhaha.com...
>
>> Really it's x[-1]'s behavior that should go, not find/rfind.
>
> I complete disagree, x[-1] as an abbreviation of x[len(x)-1] is extremely 
> useful, especially when 'x' is an expression instead of a name.

I don't think the ability to easily index sequences from the right is
in dispute. Just the fact that negative numbers on their own provide
this functionality.

Because I sometimes find it usefull to have a sequence start and
end at arbitrary indexes, I have written a table class. So I
can have a table that is indexed from e.g. -4 to +6. So how am
I supposed to easily get at that last value?

-- 
Antoon Pardon



More information about the Python-list mailing list