Listing all instance of a class
问题 I wrote a Python module, with several classes that inherit from a single class called MasterBlock . I want to import this module in a script, create several instances of these classes, and then get a list of all the existing instances of all the childrens of this MasterBlock class. I found some solutions with vars()['Blocks.MasterBlock'].__subclasses__() but as the instances I have are child of child of MasterBlock , it doesn't work. Here is some example code: Module: Class MasterBlock: def