Skip to content

Commit adabb39

Browse files
hauntsaninjacdce8p
authored andcommitted
Be strict about arg names in LSP checks
Python 3.7 has been dead for a long time, people can use PEP 570. Let's see primer, this might need to be an option
1 parent b9056f9 commit adabb39

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

mypy/checker.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2155,7 +2155,7 @@ def check_method_override_for_base_with_name(
21552155
and original_node
21562156
and codes.MUTABLE_OVERRIDE in self.options.enabled_error_codes
21572157
and self.is_writable_attribute(original_node)
2158-
and not is_subtype(original_type, typ, ignore_pos_arg_names=True)
2158+
and not is_subtype(original_type, typ)
21592159
):
21602160
base_str, override_str = format_type_distinctly(
21612161
original_type, typ, options=self.options
@@ -2166,8 +2166,7 @@ def check_method_override_for_base_with_name(
21662166
)
21672167
self.fail(msg, context)
21682168
elif isinstance(original_type, UnionType) and any(
2169-
is_subtype(typ, orig_typ, ignore_pos_arg_names=True)
2170-
for orig_typ in original_type.items
2169+
is_subtype(typ, orig_typ) for orig_typ in original_type.items
21712170
):
21722171
# This method is a subtype of at least one union variant.
21732172
if (
@@ -2293,7 +2292,7 @@ def check_override(
22932292
# Use boolean variable to clarify code.
22942293
fail = False
22952294
op_method_wider_note = False
2296-
if not is_subtype(override, original, ignore_pos_arg_names=True):
2295+
if not is_subtype(override, original):
22972296
fail = True
22982297
elif isinstance(override, Overloaded) and self.is_forward_op_method(name):
22992298
# Operator method overrides cannot extend the domain, as

0 commit comments

Comments
 (0)