MCPcopy Index your code
hub / github.com/python/mypy / get_var

Function get_var

mypy/checkpattern.py:862–870  ·  view source on GitHub ↗

Warning: this in only true for expressions captured by a match statement. Don't call it from anywhere else

(expr: Expression)

Source from the content-addressed store, hash-verified

860
861
862def get_var(expr: Expression) -> Var:
863 """
864 Warning: this in only true for expressions captured by a match statement.
865 Don't call it from anywhere else
866 """
867 assert isinstance(expr, NameExpr), expr
868 node = expr.node
869 assert isinstance(node, Var), node
870 return node
871
872
873def get_type_range(typ: Type) -> TypeRange:

Callers 2

visit_or_patternMethod · 0.85
update_type_mapMethod · 0.85

Calls 1

isinstanceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…