Inspired by this question.
Why is there no list.clear() method in python? I\'ve found several questions here that say the correct way to do it is one of the followin
While there was no list.clear()
when this question was asked, 3.3 now has one (as requested in http://bugs.python.org/issue10516). Additionally, clear()
methods have been added to bytearray and MutableSequence to ease switching between lists and other collections (set, dict etc).
Full details of the change can be found here.