Return a Var node for an lvalue that is a name expression.
(
self,
lvalue: NameExpr,
kind: int,
inferred: bool,
has_explicit_value: bool,
is_index_var: bool,
)
| 4534 | return existing is not None and is_final_node(existing.node) |
| 4535 | |
| 4536 | def make_name_lvalue_var( |
| 4537 | self, |
| 4538 | lvalue: NameExpr, |
| 4539 | kind: int, |
| 4540 | inferred: bool, |
| 4541 | has_explicit_value: bool, |
| 4542 | is_index_var: bool, |
| 4543 | ) -> Var: |
| 4544 | """Return a Var node for an lvalue that is a name expression.""" |
| 4545 | name = lvalue.name |
| 4546 | v = Var(name) |
| 4547 | v.set_line(lvalue) |
| 4548 | v.is_inferred = inferred |
| 4549 | if kind == MDEF: |
| 4550 | assert self.type is not None |
| 4551 | v.info = self.type |
| 4552 | v.is_initialized_in_class = True |
| 4553 | v.allow_incompatible_override = name in ALLOW_INCOMPATIBLE_OVERRIDE |
| 4554 | if kind != LDEF: |
| 4555 | v._fullname = self.qualified_name(name) |
| 4556 | else: |
| 4557 | # fullname should never stay None |
| 4558 | v._fullname = name |
| 4559 | v.is_ready = False # Type not inferred yet |
| 4560 | v.has_explicit_value = has_explicit_value |
| 4561 | v.is_index_var = is_index_var |
| 4562 | return v |
| 4563 | |
| 4564 | def make_name_lvalue_point_to_existing_def( |
| 4565 | self, lval: NameExpr, explicit_type: bool, is_final: bool |
no test coverage detected