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

Method visit_assignment_expr

mypy/checkexpr.py:4462–4474  ·  view source on GitHub ↗
(self, e: AssignmentExpr)

Source from the content-addressed store, hash-verified

4460 return result
4461
4462 def visit_assignment_expr(self, e: AssignmentExpr) -> Type:
4463 value = self.accept(e.value)
4464 binder_version = self.chk.binder.version
4465 self.chk.check_assignment(e.target, e.value)
4466 if self.chk.binder.version != binder_version:
4467 self.chk.assignment_expression_effect += 1
4468 self.chk.check_final(e)
4469 if not has_uninhabited_component(value):
4470 # TODO: can we get rid of this extra store_type()?
4471 # Usually, check_assignment() already stores the lvalue type correctly.
4472 self.chk.store_type(e.target, value)
4473 self.find_partial_type_ref_fast_path(e.target)
4474 return value
4475
4476 def visit_unary_expr(self, e: UnaryExpr) -> Type:
4477 """Type check an unary operation ('not', '-', '+' or '~')."""

Callers

nothing calls this directly

Calls 6

acceptMethod · 0.95
check_assignmentMethod · 0.80
check_finalMethod · 0.80
store_typeMethod · 0.80

Tested by

no test coverage detected