Hacker News new | ask | show | jobs
by leni536 11 days ago
This is what the typing spec says about type narrowing[1]:

"Type checkers should narrow the types of expressions in certain contexts. This behavior is currently largely unspecified."

Have fun.

[1] https://typing.python.org/en/latest/spec/narrowing.html#type...