Allow __slots__ on classes with Py_TPFLAGS_ITEMS_AT_END #103740
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
type-bug
An unexpected behavior, bug, or error
Bug report
If a base class is a
PyVarObject
, classes inheriting from that base cannot add__dict__
or__weakref__
through__slots__
declaration on the class. If__slots__
is not empty, the following exception is raised:TypeError: nonempty __slots__ not supported for subtype of '...'
Assume that we have a
PyVarObject
foo.FooBase
class (implementation below). Trying to inherit from the class and requesting weakref support doesn't work.`foo` module implementation
Your environment
CC: @encukou
The text was updated successfully, but these errors were encountered: