Just wondering

Jaime Fernandez del Rio jaime.frio at gmail.com
Fri May 15 08:36:39 EDT 2009

> (1) building another throwaway list and
> (2) function call overhead for calling doit()
> You can avoid (1) by using filter() instead of map()

Are you sure of this? My python returns, when asked for help(filter) :

Help on built-in function filter in module __builtin__:

    filter(function or None, sequence) -> list, tuple, or string

    Return those items of sequence for which function(item) is true.  If
    function is None, return the items that are true.  If sequence is a tuple
    or string, return the same type, else return a list.

I'm afraid there is no builtin function to do an inplace modification
of a sequence...

( O.o)
( > <) Este es Conejo. Copia a Conejo en tu firma y ayúdale en sus
planes de dominación mundial.

More information about the Python-list mailing list