Courtesy of @delfick
So if we have two files
# a.pyfromtypingimportassert_neverimportbdefswitch[T_Choice: b.One|b.Two](choice: type[T_Choice]) ->None:
matchchoice:
caseb.One:
print(1)
caseb.Two:
print(2)
case _:
assert_never(choice)
switch(b.One)
and
# b.pyclassOne: ...
classTwo: ...
Then I get no errors with mypy 1.15 and this error with 1.16
a.py:13: error: Argument 1 to "assert_never" has incompatible type "type[Two] | Never"; expected "Never" [arg-type]
Courtesy of @delfick
So if we have two files
and
Then I get no errors with mypy 1.15 and this error with 1.16