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
Multiple inheritance with multiple slotted parent classes can be used, but only one parent is allowed to have attributes created by slots (the other bases must have empty slot layouts) - violations raise TypeError.
Activity
[-]Multiple inheritance error[/-][+]Multiple inheritance error when using slots[/+]hynek commentedon Aug 18, 2020
To be clear: #635 has nothing to do with this problem and the problem exists in 19.3 too.
I suspect it's related to the way we create slotted classes in
attrs/src/attr/_make.py
Line 711 in b02335f
Since slots become True by default in NG, we should have a look if we can fix this.
Tinche commentedon Aug 18, 2020
An even smaller test case:
Tinche commentedon Aug 18, 2020
Actually, C doesn't even have to be an attrs class:
In fact, browsing the Python docs (https://docs.python.org/3/reference/datamodel.html#notes-on-using-slots):
So this is a Python limitation.
hynek commentedon Aug 19, 2020
Thank you for the research Tin! I will add an entry to the glossary.
jacobg commentedon Aug 19, 2020
@Tinche @hynek Thank you for looking into this issue!