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
(A bit of an obscure edge case, but worth documenting for future reference.)
The require-subclass mode warns of any classes which could be slotted, but are not.
classA(int): # slots-required error triggered because A cloud be slotted, but isn't
...
classB(A): # no slots-required error because B cannot be slotted (because one of its superclasses isn't)
...
However, protocols complicate things a bit:
classMyProto(Protocol): # no slots-required error because protocols are not concrete classes
...
classC(MyProto): # no slots-required error because one of its superclasses has no slots.
...
In the last case, we might want to emit a warning that C could be slotted if its protocol is. In the current situation, C is more-or-less silently allowed to not have slots.
Note that this problem is not present in ABC because they are meant to be inherited from and do trigger slots-required themselves.
The text was updated successfully, but these errors were encountered:
(A bit of an obscure edge case, but worth documenting for future reference.)
The
require-subclass
mode warns of any classes which could be slotted, but are not.However, protocols complicate things a bit:
In the last case, we might want to emit a warning that
C
could be slotted if its protocol is. In the current situation,C
is more-or-less silently allowed to not have slots.Note that this problem is not present in
ABC
because they are meant to be inherited from and do trigger slots-required themselves.The text was updated successfully, but these errors were encountered: