Skip to content

Commit 9670d58

Browse files
committed
FormalArgument#pos can be 0...
1 parent 0769825 commit 9670d58

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mypy/subtypes.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,11 +1127,13 @@ def unify_generic_callable(type: CallableType, target: CallableType,
11271127
for i in range(len(target.arg_types)):
11281128
if target.arg_names[i]:
11291129
c = mypy.constraints.infer_constraints(
1130-
argument_names_map[target.arg_names[i]], target.arg_types[i], mypy.constraints.SUPERTYPE_OF)
1130+
argument_names_map[target.arg_names[i]],
1131+
target.arg_types[i],
1132+
mypy.constraints.SUPERTYPE_OF)
11311133
constraints.extend(c)
11321134
# check pos-only arguments
11331135
for arg, target_arg in zip(type.formal_arguments(), target.formal_arguments()):
1134-
if arg.pos and target_arg.pos:
1136+
if arg.pos is not None and target_arg.pos is not None:
11351137
c = mypy.constraints.infer_constraints(
11361138
arg.typ, target_arg.typ, mypy.constraints.SUPERTYPE_OF)
11371139
constraints.extend(c)

0 commit comments

Comments
 (0)