basedmypy icon indicating copy to clipboard operation
basedmypy copied to clipboard

`FunctionType` doesn't narrow properly from a callable

Open KotlinIsland opened this issue 1 year ago • 0 comments

from types import FunctionType

fn: "() -> int"
assert isinstance(fn, FunctionType)
reveal_type(fn)  # Revealed type is "types.FunctionType" (narrowed from "() -> int")

KotlinIsland avatar Aug 28 '24 13:08 KotlinIsland