Skip to content

Commit

Permalink
remove walrusses
Browse files Browse the repository at this point in the history
  • Loading branch information
tyralla committed Jul 4, 2024
1 parent cbf7574 commit 9a947a5
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions mypy/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,15 +660,16 @@ def _visit_overloaded_func_def(self, defn: OverloadedFuncDef) -> None:
if defn.impl:
defn.impl.accept(self)
if (
isinstance(impl := defn.impl, Decorator)
and isinstance(ct := impl.func.type, CallableType)
and ((deprecated := ct.deprecated) is not None)
isinstance(defn.impl, Decorator)
and isinstance(defn.impl.func.type, CallableType)
and ((deprecated := defn.impl.func.type.deprecated) is not None)
):
if isinstance(ct := defn.type, (CallableType, Overloaded)):
ct.deprecated = deprecated
if isinstance(defn.type, (CallableType, Overloaded)):
defn.type.deprecated = deprecated
for subdef in defn.items:
if isinstance(ct := get_proper_type(subdef.type), (CallableType, Overloaded)):
ct.deprecated = deprecated
type_ = get_proper_type(subdef.type)
if isinstance(type_, (CallableType, Overloaded)):
type_.deprecated = deprecated
if not defn.is_property:
self.check_overlapping_overloads(defn)
if defn.type is None:
Expand Down

0 comments on commit 9a947a5

Please sign in to comment.