Skip to content

Commit 6775bef

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

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

mypy/checker.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1988,7 +1988,9 @@ def check_method_override_for_base_with_name(
19881988
# If the attribute is read-only, allow covariance
19891989
pass
19901990
else:
1991-
self.msg.signature_incompatible_with_supertype(defn.name, name, base.name, context, original_type, typ)
1991+
self.msg.signature_incompatible_with_supertype(
1992+
defn.name, name, base.name, context, original_type, typ
1993+
)
19921994
return False
19931995

19941996
def bind_and_map_method(

mypy/messages.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,9 @@ def signature_incompatible_with_supertype(
11431143
target = self.override_target(name, name_in_super, supertype)
11441144
self.fail(f'Signature of "{name}" incompatible with {target}', context, code=code)
11451145

1146-
original_str, override_str = format_type_distinctly(original, override, options=self.options, bare=True)
1146+
original_str, override_str = format_type_distinctly(
1147+
original, override, options=self.options, bare=True
1148+
)
11471149

11481150
INCLUDE_DECORATOR = True # Include @classmethod and @staticmethod decorators, if any
11491151
ALLOW_DUPS = True # Allow duplicate notes, needed when signatures are duplicates
@@ -1165,12 +1167,7 @@ def signature_incompatible_with_supertype(
11651167
code=code,
11661168
)
11671169
else:
1168-
self.note(
1169-
original_str,
1170-
context,
1171-
offset=ALIGN_OFFSET + 2 * OFFSET,
1172-
code=code,
1173-
)
1170+
self.note(original_str, context, offset=ALIGN_OFFSET + 2 * OFFSET, code=code)
11741171

11751172
self.note("Subclass:", context, offset=ALIGN_OFFSET + OFFSET, code=code)
11761173
if isinstance(override, (CallableType, Overloaded)):
@@ -1183,12 +1180,7 @@ def signature_incompatible_with_supertype(
11831180
code=code,
11841181
)
11851182
else:
1186-
self.note(
1187-
override_str,
1188-
context,
1189-
offset=ALIGN_OFFSET + 2 * OFFSET,
1190-
code=code,
1191-
)
1183+
self.note(override_str, context, offset=ALIGN_OFFSET + 2 * OFFSET, code=code)
11921184

11931185
def pretty_callable_or_overload(
11941186
self,

0 commit comments

Comments
 (0)