🧠TIL
Mypy Narrowing of Union[T, None]
Mypy only narrows Union[T, None] when it sees an explicit check for None or an assertion. This behaviour leads to type errors that may seem unintuitive to solve.
Mypy only narrows Union[T, None] when it sees an explicit check for None or an assertion. This behaviour leads to type errors that may seem unintuitive to solve.