Closed
Description
I often encounter situations where I would like to extract some test into a function, but then mypy will not understand the implication on the types of the arguments. This goes against the intention that type checking will guide the programmer towards writing more readable code.
Similar case is functions like callable as in #1973, which requires hard coding so that mypy will understand.
I suggest a @type_effect
decorator, possibly something along these lines:
@type_effect(true='x <: Callable')
def callable(x: object) -> bool: ...
Although the syntax is of secondary in this case.