[Shane Holloway]
> I would agree generic clearing is a lark in terms of programming
> feature.  However, I have been asked how to clear a list more than a
> handful of times. 

list.clear() does not solve the root problem.  The question is
symptomatic of not understanding slicing.  Avoidance of that knowledge
doesn't help the person at all.  Slicing is part of Python 101 and is
basic to the language.  There is a reason this subject is presented
right at the beginning of the tutorial.

By the time a person is writing apps that modify lists in-place
(clearing and rebuilding), then they need to know how lists work.  So, a
better solution is to submit a doc patch to improve the tutorial's
presentation on the subject.

IMO, there is a much stronger case for Fredrik's proposed join()
builtin.  That addresses an issue that feels warty on the first day you
learn it and still feels that way years later.


Raymond
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to