python needs leaning stuff from other language

MRAB google at mrabarnett.plus.com
Thu Apr 2 21:53:32 EDT 2009


Zac Burns wrote:
> Is it really worth it to not implement list.clear and answer this
> question over and over again?
> 
> I see no reason that a list shouldn't have a .clear method.
> 
Does dict have a .clear method? Yes.

Does set have a .clear method? Yes.

Does list have a .clear method? No.

Of course, with a list you can do del my_list[:]; there's no simple
equivalent for dict or set.

But, overall, I'm +1.



More information about the Python-list mailing list