Consider this:
class Base:
pass
class Derived(Base):
pass
print(Base.__dict__)
print(Derived.__dict__)
print('__dict__' in Base.__dict__)
print('__dict__' in Derived.__dict__)
The output is:
{'__module__': '__main__', '__dict__': <attribute '__dict__' of 'Base' objects>, '__weakref__': <attribute '__weakref__' of 'Base' objects>, '__doc__': None}
{'__module__': '__main__', '__doc__': None}
True
False
Why are the '__dict__'
and '__weakref__'
keys missing for the Derived
class?
What does this mean/affect?