Let's take a look of the following example:
>>> class Foo(object):
... pass
...
My current understanding is when Python interpreter reads the line class Foo(object)
[Foo class definition], it will create a Foo class object in memory.
Then I did the following two tests:
>>> dir()
['Foo', '__builtins__', '__doc__', '__name__', '__package__']
It looks like the Python interpreter has stored 'Foo' class object in memory.
>>> id(Foo)
140608157395232
It seems Foo class object is at memory address: 140608157395232.
Is my reasoning correct? If not, when does Python create class object in memory?