-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
tyMulti-file analysis & type inferenceMulti-file analysis & type inference
Description
The goal of this issue is to make this mdtest pass:
def get_bool() -> bool: ...
def get_object() -> object: ...
class A: ...
class B: ...
x = get_object()
reveal_type(x) # revealed: object
match x:
case A():
reveal_type(x) # revealed: A
case B():
reveal_type(x) # revealed: B
reveal_type(x) # revealed: objectThis should just require filling in the TODO for MatchClass at
| None // TODO |
We don't need to worry about arguments yet; the goal here is just to narrow based on the implicit isinstance check performed by the class pattern.
See https://docs.python.org/3/reference/compound_stmts.html#class-patterns for the documentation of the language feature.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
tyMulti-file analysis & type inferenceMulti-file analysis & type inference