mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
Added a new stable API function ``PyType_FromMetaclass``, which mirrors the behavior of ``PyType_FromModuleAndSpec`` except that it takes an additional metaclass argument. This is, e.g., useful for language binding tools that need to store additional information in the type object.
8 lines
509 B
ReStructuredText
8 lines
509 B
ReStructuredText
Added the new function :c:func:`PyType_FromMetaclass`, which generalizes the
|
|
existing :c:func:`PyType_FromModuleAndSpec` using an additional metaclass
|
|
argument. This is useful for language binding tools, where it can be used to
|
|
intercept type-related operations like subclassing or static attribute access
|
|
by specifying a metaclass with custom slots.
|
|
|
|
Importantly, :c:func:`PyType_FromMetaclass` is available in the Limited API,
|
|
which provides a path towards migrating more binding tools onto the Stable ABI.
|