isinstance erases type info #12949
Labels
bug
mypy got something wrong
topic-type-narrowing
Conditional type narrowing / binder
topic-type-variables
Bug Report
Accessing a variable of a generic type after an
if isinstance()
against a (non-generic) subclass of said type changes the variable's type to<nothing>
within theisinstance
clause scope:Expected Behavior
No error.
Actual Behavior
Your Environment
The text was updated successfully, but these errors were encountered: