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

Function is_class_var

mypy/nodes.py:5320–5324  ·  view source on GitHub ↗

Return whether the expression is ClassVar[...]

(expr: NameExpr)

Source from the content-addressed store, hash-verified

5318
5319
5320def is_class_var(expr: NameExpr) -> bool:
5321 """Return whether the expression is ClassVar[...]"""
5322 if isinstance(expr.node, Var):
5323 return expr.node.is_classvar
5324 return False
5325
5326
5327def is_final_node(node: SymbolNode | None) -> bool:

Callers 4

transform_class_defFunction · 0.90
add_attrMethod · 0.90
find_attr_initializersFunction · 0.90

Calls 1

isinstanceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…