Skip to content

Commit 288d367

Browse files
committed
this check for cls arguments got dropped in the merge, put it back
1 parent dd865d2 commit 288d367

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mypy/stubtest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,12 +958,13 @@ def from_overloadedfuncdef(stub: nodes.OverloadedFuncDef) -> Signature[nodes.Arg
958958
for func in map(_resolve_funcitem_from_decorator, stub.items):
959959
assert func is not None
960960
args = maybe_strip_cls(stub.name, func.arguments)
961-
for arg in args:
961+
for index, arg in enumerate(args):
962962
if (
963963
arg.variable.name.startswith("__")
964964
or arg.pos_only
965965
or assume_positional_only
966966
or arg.variable.name.strip("_") == "self"
967+
or (index == 0 and arg.variable.name.strip("_") == "cls")
967968
):
968969
is_arg_pos_only[arg.variable.name].add(True)
969970
else:

0 commit comments

Comments
 (0)