How do I get a list of all instances of a given class?
Python does not keep track of all instances of a class (or of a built-in type). You can program the class's constructor to keep track of all instances by keeping a list of weak references to each instance.
CATEGORY: programming
last updated 2 years ago by effbot #
