"Canonical" way of deleting elements from lists

Nick Craig-Wood nick at craig-wood.com
Wed Jan 9 15:30:06 CET 2008


Fredrik Lundh <fredrik at pythonware.com> wrote:
>  Nick Craig-Wood wrote:
> 
> > Using keywords[:] stops the creation of another temporary list.
> 
>  in CPython, "list[:] = iter" actually creates a temporary list object on 
>  the inside, in case "iter" isn't already a list or a tuple.
> 
>  (see the implementation of PySequence_Fast() for details).

Ah, OK, thanks for the correction!

-- 
Nick Craig-Wood <nick at craig-wood.com> -- http://www.craig-wood.com/nick


More information about the Python-list mailing list