This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients terry.reedy
Date 2010-11-23.23:37:44
SpamBayes Score 0.00026732197
Marked as misclassified No
Message-id <>
Add list.clear() method with obvious semantics.

1. parallel to set/dict/defaultdict/deque.clear(),
   usable in generic mutable collection function;
2. makes it easier to switch between list and other collection class;
3. current alternatives are not as obvious;
4. some people seem to expect it.

1. unneeded; del l[:] or l[:]=[] do same already.

Guido: (python-ideas list, 'Set Syntax' thread, today)
"FWIW I'm fine with adding list.clear() to 3.3."
Date User Action Args
2010-11-23 23:37:48terry.reedysetrecipients: + terry.reedy
2010-11-23 23:37:48terry.reedysetmessageid: <>
2010-11-23 23:37:44terry.reedylinkissue10516 messages
2010-11-23 23:37:44terry.reedycreate