[Python-ideas] New list methods
Zac Burns
zac256 at gmail.com
Tue May 5 19:52:54 CEST 2009
I've tried to 'r' search the list using the start/stop parameters to no avail.
l = [1, 2, 3, 2, 1]
l.index(2, 0, 4) == 1 # True
l.index(2, 4, 0) # ValueError
l.index(2, -1, 0) # ValueError
--
Zachary Burns
(407)590-4814
Aim - Zac256FL
Production Engineer (Digital Overlord)
Zindagi Games
On Tue, May 5, 2009 at 10:48 AM, MRAB <google at mrabarnett.plus.com> wrote:
> Zac Burns wrote:
>>
>> I would like to see the following methods added to lists...
>>
>> rindex : Return first index of value from the right
>> rremove: Return first occurence of value from the right.
>>
> index() has start and stop arguments. Would anything be gained
> if remove() had them too?
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>
More information about the Python-ideas
mailing list