[Python-ideas] New list methods

Jeremy Banks jeremy at jeremybanks.ca
Tue May 5 19:11:44 CEST 2009


I believe the proposal is to have l.rremove() take a value parameter,
and remove the last occurrence of that value from the list, not just
the last value in the list.

My assumpting is that their basic functionality would work like this.

    l = [1, 2, 3, 2, 1]
    l.rindex(2) == 3
    l.rremove(2)
    l == [1, 2, 3, 1]

I'd say +1.

On 2009-05-05, Oleg Broytmann <phd at phd.pp.ru> wrote:
> On Tue, May 05, 2009 at 09:25:16AM -0700, 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.
>
>    l.rremove() is the same as l.pop() or l.pop(-1)
>
> Oleg.
> --
>      Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
>            Programmers don't die, they just GOSUB without RETURN.
> _______________________________________________
> 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