Skip to content

Commit 94f4ce1

Browse files
authored
FormalArgument#pos can be 0...
1 parent a455428 commit 94f4ce1

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
@@ -1210,11 +1210,13 @@ def unify_generic_callable(type: CallableType, target: CallableType,
12101210
for i in range(len(target.arg_types)):
12111211
if target.arg_names[i]:
12121212
c = mypy.constraints.infer_constraints(
1213-
argument_names_map[target.arg_names[i]], target.arg_types[i], mypy.constraints.SUPERTYPE_OF)
1213+
argument_names_map[target.arg_names[i]],
1214+
target.arg_types[i],
1215+
mypy.constraints.SUPERTYPE_OF)
12141216
constraints.extend(c)
12151217
# check pos-only arguments
12161218
for arg, target_arg in zip(type.formal_arguments(), target.formal_arguments()):
1217-
if arg.pos and target_arg.pos:
1219+
if arg.pos is not None and target_arg.pos is not None:
12181220
c = mypy.constraints.infer_constraints(
12191221
arg.typ, target_arg.typ, mypy.constraints.SUPERTYPE_OF)
12201222
constraints.extend(c)

0 commit comments

Comments
 (0)