emptying a list

Geoffrey Clements geoffrey.clementsNO at SPAMbaesystems.com
Thu Oct 1 12:15:00 EDT 2009


"lallous" <lallous at lgwm.org> wrote in message news:ha2htc$u9u$1 at aioe.org...
> Hello
>
> What is faster when clearing a list?
>
> del L[:]
>
> or
>
> L = []
>

Oh, "L = []" definitely, on the basis that there are fewer characters to 
type.


http://docs.python.org/3.1/library/profile.html

-- 
Geoff 





More information about the Python-list mailing list