I
Ivan Yurchenko
Hello.
I've done the following in CPython 2.7.3 and 3.3.0 (and also in PyPy 2.0b1):
(<class 'set'>, <class 'weakproxy'>, True)
So, type doesn't use object's __class__ to determine its class. I'm looking
for some CPyhton implementation details - how does class identification with
type() work? According to CPython's sources it looks like there is a "marker"
of actual object's class associated with each PyObject - _typeobject struct,
which is used to identify the class by type(). Am I right?
Thank you.
- Ivan Yurchenko.
I've done the following in CPython 2.7.3 and 3.3.0 (and also in PyPy 2.0b1):
(<class 'set'>, <class 'weakproxy'>, True)
So, type doesn't use object's __class__ to determine its class. I'm looking
for some CPyhton implementation details - how does class identification with
type() work? According to CPython's sources it looks like there is a "marker"
of actual object's class associated with each PyObject - _typeobject struct,
which is used to identify the class by type(). Am I right?
Thank you.
- Ivan Yurchenko.