Skip to content

Commit 6163787

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent a6d0e59 commit 6163787

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

mypy/semanal.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,10 +1265,10 @@ def process_deprecated_overload(self, defn: OverloadedFuncDef) -> None:
12651265
if defn.is_property:
12661266
return
12671267

1268-
if isinstance(impl := defn.impl, Decorator) and isinstance(
1269-
type_ := impl.func.type, CallableType
1270-
) and (
1271-
(deprecated := type_.deprecated) is not None
1268+
if (
1269+
isinstance(impl := defn.impl, Decorator)
1270+
and isinstance(type_ := impl.func.type, CallableType)
1271+
and ((deprecated := type_.deprecated) is not None)
12721272
):
12731273
if isinstance(defn.type, Overloaded):
12741274
defn.type.deprecated = deprecated
@@ -1713,9 +1713,7 @@ def visit_decorator(self, dec: Decorator) -> None:
17131713
dec.func.dataclass_transform_spec = self.parse_dataclass_transform_spec(d)
17141714
elif (deprecated := self.get_deprecated(d)) is not None:
17151715
if isinstance(type_ := dec.func.type, CallableType):
1716-
type_.deprecated = (
1717-
f"function {dec.fullname} is deprecated: {deprecated}"
1718-
)
1716+
type_.deprecated = f"function {dec.fullname} is deprecated: {deprecated}"
17191717
elif not dec.var.is_property:
17201718
# We have seen a "non-trivial" decorator before seeing @property, if
17211719
# we will see a @property later, give an error, as we don't support this.

0 commit comments

Comments
 (0)