![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.python archiveQuestion about idioms for clearing a list
From: Steven Watanabe <swatanabe@alias.com>
Date: Tue Jan 31 2006 - 17:57:03 CET
I know that the standard idioms for clearing a list are:
(1) mylist[:] = []
I guess I'm not in the "slicing frame of mind", as someone put it, but
(3) mylist = []
Why are (1) and (2) preferred? I think the first two are changing the
Thanks in advance.
-- Steven.Received on Tue Feb 7 20:23:31 2006 |