Skip to content

Commit d811a82

Browse files
committed
cosmetic
1 parent d7df8cd commit d811a82

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mypy/subtypes.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ def is_callable_subtype(left: CallableType, right: CallableType,
353353
# This fetches the synthetic argument that's from the *args
354354
right_by_position = right.argument_by_position(j)
355355
assert right_by_position is not None
356-
if not is_left_more_general(left_by_position, right_by_position,
356+
if not are_args_compatible(left_by_position, right_by_position,
357357
ignore_pos_arg_names):
358358
return False
359359
j += 1
@@ -376,7 +376,7 @@ def is_callable_subtype(left: CallableType, right: CallableType,
376376
# This fetches the synthetic argument that's from the **kwargs
377377
right_by_name = right.argument_by_name(name)
378378
assert right_by_name is not None
379-
if not is_left_more_general(left_by_name, right_by_name,
379+
if not are_args_compatible(left_by_name, right_by_name,
380380
ignore_pos_arg_names):
381381
return False
382382
continue
@@ -421,7 +421,7 @@ def is_callable_subtype(left: CallableType, right: CallableType,
421421

422422
assert left_arg is not None
423423

424-
if not is_left_more_general(left_arg, right_arg, ignore_pos_arg_names):
424+
if not are_args_compatible(left_arg, right_arg, ignore_pos_arg_names):
425425
return False
426426

427427
done_with_positional = False
@@ -462,14 +462,14 @@ def is_callable_subtype(left: CallableType, right: CallableType,
462462
return False
463463

464464
# All *required* left-hand arguments must have a corresponding
465-
# right-hand argument.
465+
# right-hand argument. Optional args it does not matter.
466466
if left_arg.required and right_by_pos is None and right_by_name is None:
467467
return False
468468

469469
return True
470470

471471

472-
def is_left_more_general(
472+
def are_args_compatible(
473473
left: FormalArgument,
474474
right: FormalArgument,
475475
ignore_pos_arg_names: bool) -> bool:

0 commit comments

Comments
 (0)