I'd like to make a class automatically log all the objects of that class when they are instantiated, so, given this little piece of code:
class Comet:
comets = []
__init__(self, mass):
self.mass = mass
Comet.comets.append(**instance name as a string**)
HalleysComet = Comet(3*10**14)
Temple 1 = Comet(7.9*10**13)
print(str(Comet.comets))
The output would be this:
['HalleysComet', 'Temple 1']