I don't think there's a good way to fix it properly. To allow mixing slots from multiple bases (e.g. if the other base had __setitem__), we'd need to allocate new sub-slot structs for the derived type -- as heap types do. Also, it sounds pretty scary to change such long-standing behavior :)
The best we could do that I can think of would be to detect the situation and emit warnings -- possibly DeprecationWarnings, which could be changed to errors in a few releases.
The text was updated successfully, but these errors were encountered:
encukou commentedNov 8, 2022
If the following is implemented using static types C API, the derived class doesn't inherit
__getitem__
:C implementation
The reason is that
type_ready_inherit_as_structs
is only called wih one base, not all of them.I don't think there's a good way to fix it properly. To allow mixing slots from multiple bases (e.g. if the other base had
__setitem__
), we'd need to allocate new sub-slot structs for the derived type -- as heap types do. Also, it sounds pretty scary to change such long-standing behavior :)The best we could do that I can think of would be to detect the situation and emit warnings -- possibly DeprecationWarnings, which could be changed to errors in a few releases.
The text was updated successfully, but these errors were encountered: