As far as I understand, some typing.disjoint
would be used in stubs, where we can’t really say some __slots__
is non empty (without annotating it as tuple[str, *tuple[str, …]]
). If it is only use in stubs though, wouldn’t it be smarter to make it an attribute of typeshed.pyi
? The decorator wouldn’t really do much at runtime anyways (except for checking that __slots__
exists and is not empty). Having it be am attribute of typeshed would also prevent typing
from getting more cluttered than it already is.
Could a moderator close this thread in favor of PEP 800: Solid bases in the type system ?