Return if var is an instance variable according to PEP 526.
(var: Var)
| 843 | |
| 844 | |
| 845 | def 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 | |
| 857 | def analyze_var( |
no outgoing calls
no test coverage detected
searching dependent graphs…