DetachHead / basedpyright

pyright fork with various type checking improvements, improved vscode support and pylance features built into the language server
http://docs.basedpyright.com/
Other
601 stars 12 forks source link

`reportUnreachable` false positive when using `isinstance` to compare `Callable` type against non-final class that does not define a `__call__` #452

Open DetachHead opened 1 week ago

DetachHead commented 1 week ago
from typing import Callable

class Foo:
    ...

class Bar(Foo):
    def __call__(self): ...
def foo[T, **P](value: Callable[P, T]):
    if isinstance(value, Foo):
        print(1) # error: unreachable, actually reached at runtime

foo(Bar())

upstream issue introduced in 1.1.369. playground