You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new type system allows non-empty __slots__ only
for fixed-size objects.
Meta-types are types which instances are also types.
types are variable-sized, because they take the slot
definitions for their instances, so the cannot have
extra members from their meta-type.
The proposed solution allows for two things:
a) meta-types can have slots
b) extensions get access to the whole type object and
can create extended types with private fields.
The changes providing this are quite simple:
replace the internal hidden "etype" and turn it into
an explicit PyHeapTypeObject in object.h
instead of a fixed offset into the former etype, the
slots
calculation is based upon tp_basicsize.
To keep things easy, I added a macro which does this
calculation, and member access read now like so:
This patch has been tested thoroughly in my own code since
Python 2.2, and I think it is ripe to get into the
distribution.
It has almost no impact on speed or complexity.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: