If I type slots:
class Foo:
__slots__: Tuple[()] = tuple()
Then, in strict mode, mypy (0.812) tells me:
Incompatible types in assignment (expression has type "Tuple[<nothing>, ...]", variable has type "Tuple[]")
I can write:
__slots__: Tuple[()] = cast(Tuple[()], tuple())
But this is ugly. What is the canonical way to do this? What does mypy mean by Tuple[<nothing>, ...]
? Tuples are immutable so surely an empty tuple shouldn't be... a variable amount of nothing..?