Skip to content

Commit 9a947a5

Browse files
committed
remove walrusses
1 parent cbf7574 commit 9a947a5

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

mypy/checker.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -660,15 +660,16 @@ def _visit_overloaded_func_def(self, defn: OverloadedFuncDef) -> None:
660660
if defn.impl:
661661
defn.impl.accept(self)
662662
if (
663-
isinstance(impl := defn.impl, Decorator)
664-
and isinstance(ct := impl.func.type, CallableType)
665-
and ((deprecated := ct.deprecated) is not None)
663+
isinstance(defn.impl, Decorator)
664+
and isinstance(defn.impl.func.type, CallableType)
665+
and ((deprecated := defn.impl.func.type.deprecated) is not None)
666666
):
667-
if isinstance(ct := defn.type, (CallableType, Overloaded)):
668-
ct.deprecated = deprecated
667+
if isinstance(defn.type, (CallableType, Overloaded)):
668+
defn.type.deprecated = deprecated
669669
for subdef in defn.items:
670-
if isinstance(ct := get_proper_type(subdef.type), (CallableType, Overloaded)):
671-
ct.deprecated = deprecated
670+
type_ = get_proper_type(subdef.type)
671+
if isinstance(type_, (CallableType, Overloaded)):
672+
type_.deprecated = deprecated
672673
if not defn.is_property:
673674
self.check_overlapping_overloads(defn)
674675
if defn.type is None:

0 commit comments

Comments
 (0)