class Foo:
pass
>>> f = test.Foo()
Lets look into the class instance …
>>> dir(f)
['__add__', [__class__] ...]
Oooh! Lets look into the class instance metadata …
>>> dir(f.__class__)
['__add__', [__class__] ...]
hmm … was expecting attributes of __class__ ; but returns back attributes of f
Trying a hit and trial …
>>> dir(f.__class__.__class__)
['__abstractmethods__', '__base__' ...]
hmm … why twice a charm?
dir(f)anddir(f.__class__)are showing the attributes of two different things. It’s just that your empty object has the same attributes as its own class. Try this: