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

Function is_instance_var

mypy/checkmember.py:845–854  ·  view source on GitHub ↗

Return if var is an instance variable according to PEP 526.

(var: Var)

Source from the content-addressed store, hash-verified

843
844
845def is_instance_var(var: Var) -> bool:
846 """Return if var is an instance variable according to PEP 526."""
847 return (
848 # check the type_info node is the var (not a decorated function, etc.)
849 var.name in var.info.names
850 and var.info.names[var.name].node is var
851 and not var.is_classvar
852 # variables without annotations are treated as classvar
853 and not var.is_inferred
854 )
855
856
857def analyze_var(

Callers 2

analyze_varFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…