From 1422af6beedd18b8aadace6b26af88ce102d3fc3 Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Mon, 26 Oct 2020 19:19:02 -0700 Subject: [PATCH] checkexpr: [minor] move node specific logic into visit The has_uninhabited_component was formerly there to avoid clobbering the store_type call in find_partial_type_ref_fast_path. But this interaction is avoided by making the store_type call earlier. --- mypy/checkexpr.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mypy/checkexpr.py b/mypy/checkexpr.py index c186ab1434ef..40204e7c9ccf 100644 --- a/mypy/checkexpr.py +++ b/mypy/checkexpr.py @@ -2849,6 +2849,7 @@ def visit_assignment_expr(self, e: AssignmentExpr) -> Type: value = self.accept(e.value) self.chk.check_assignment(e.target, e.value) self.chk.check_final(e) + self.chk.store_type(e.target, value) self.find_partial_type_ref_fast_path(e.target) return value @@ -3903,9 +3904,6 @@ def accept(self, assert typ is not None self.chk.store_type(node, typ) - if isinstance(node, AssignmentExpr) and not has_uninhabited_component(typ): - self.chk.store_type(node.target, typ) - if (self.chk.options.disallow_any_expr and not always_allow_any and not self.chk.is_stub and pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy