Skip to content

Commit d98e716

Browse files
committed
Fixes for tests
Given that this changes stubgen, it may make sense to have a more targeted fix.
1 parent 6764f99 commit d98e716

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

mypy/stubgen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ def _get_func_args(self, o: FuncDef, ctx: FunctionContext) -> list[ArgSig]:
556556
if not isinstance(get_proper_type(annotated_type), AnyType):
557557
typename = self.print_annotation(annotated_type)
558558

559-
if actually_pos_only_args and arg_.pos_only:
559+
if actually_pos_only_args and (arg_.pos_only and kind != ARG_STAR):
560560
pos_only_marker_position += 1
561561

562562
if kind.is_named() and not any(arg.name.startswith("*") for arg in args):

test-data/unit/pythoneval.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ with f('') as s:
10271027
reveal_type(s)
10281028
[out]
10291029
_program.py:13: note: Revealed type is "def (x: builtins.int) -> contextlib._GeneratorContextManager[builtins.str, None, None]"
1030-
_program.py:14: note: Revealed type is "def (*x: builtins.str) -> contextlib._GeneratorContextManager[builtins.int, None, None]"
1030+
_program.py:14: note: Revealed type is "def (*builtins.str) -> contextlib._GeneratorContextManager[builtins.int, None, None]"
10311031
_program.py:16: error: Argument 1 to "f" has incompatible type "str"; expected "int"
10321032
_program.py:17: note: Revealed type is "builtins.str"
10331033

0 commit comments

Comments
 (0)