You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 the isinstance clause scope:
note: Revealed type is "builtins.list[T`-1]"
note: Revealed type is "<nothing>"
error: <nothing> has no attribute "pop" [attr-defined]
note: Revealed type is "builtins.list[T`-1]"
Activity
erictraut commentedon Aug 13, 2023
This is a duplicate of #8252.
This bug report is a simpler demonstration of the bug, so it might be worth keeping this one open and closing the other.
ichard26 commentedon Aug 22, 2023
#8252, which I just closed, contains some more examples of this issue.
erictraut commentedon Aug 22, 2023
I think this might also be the same as #15793.
Do not narrow types to Never with binder (python#18972)
Do not narrow types to Never with binder (#18972)