-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
Description
The type checker should know about isinstance checks. For example, this code should be valid:
def f(x: object) -> None:
if isinstance(x, str):
# x has type str here.
print(x + 'foo') # ok
Initially only support cases where the first argument is a variable and the 'if' condition only contains an isinstance check. Later, consider extending this to more complex cases.