Home Posts Topics Members FAQ
Post your question to a community of 470,811 developers. It's quick & easy.
How [do] you clear the contents of a list subclass without creating a new object?
class L(list): .... pass .... x = L() x.append("Spam") del x[:] x [] type(x) <class '__main__.L'>
Replies have been disabled for this discussion.