list permutations and weired list.remove funtion

Aahz Maruch aahz at panix.com
Mon May 14 23:40:02 EDT 2001


In article <bxZL6.10502$sk3.2819840 at newsb.telia.net>,
Tim Gahnström /Bladerman <tim at bladerman.com> wrote:
>
>I am new to python and happende to use the function list.remov(elem) it sure
>is usufull but it rendered me som hours of extra work until I found out that
>it really dont return the list with the elemen removed.
>
>[1,2,3].remove(2) == null
>instead of
>[1,2,3].remove(2) ==[1,3]
>
>It seems like it would have been about no cost to let it work that way to?

None of the list-mutating operations return the list.  This is to make
sure you don't accidentally chain operations together incorrectly.
-- 
                      --- Aahz  <*>  (Copyright 2001 by aahz at pobox.com)

Androgynous poly kinky vanilla queer het Pythonista   http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6

"It's such a fine line between stupid and clever."  --David St. Hubbins



More information about the Python-list mailing list