Question about idioms for clearing a list

Peter Hansen peter at engcorp.com
Mon Feb 6 13:13:44 EST 2006


Steven D'Aprano wrote:
> Perhaps it is arguable that there is no need for a clear method because
> L[:] = [] is so easy to do. Personally, while I agree that it is easy, it
> is hardly intuitive or obvious, and I too would prefer an explicit clear
> method for mutable sequences.

Possibly another case where "patches are welcome"...




More information about the Python-list mailing list