Skip to content

stubtest: handle overloads with mixed pos-only params#18287

Merged
JelleZijlstra merged 10 commits into
python:masterfrom
tungol:stubtest-pos-only
Aug 23, 2025
Merged

stubtest: handle overloads with mixed pos-only params#18287
JelleZijlstra merged 10 commits into
python:masterfrom
tungol:stubtest-pos-only

Conversation

@tungol

@tungol tungol commented Dec 13, 2024

Copy link
Copy Markdown
Contributor

Fixes #17023

Stubtest should only mangle positional-only parameter names if they're positional-only in all branches of the overload. The signatures get really ugly and wrong otherwise.

I'm not sure if I did the new test_overload_signature in the best way. I couldn't figure out a way to get covert a string into a nodes.OverloadedFuncDef object with any of the techniques in existing tests in teststubtest.py. Maybe the new test case is sufficient, but I wanted to test the signature generation directly.

@JelleZijlstra
JelleZijlstra self-requested a review August 22, 2025 23:52
@JelleZijlstra
JelleZijlstra merged commit f51b699 into python:master Aug 23, 2025
13 checks passed
@tungol
tungol deleted the stubtest-pos-only branch August 23, 2025 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stubtest mishandles overloads where param is pos-only in one overload

2 participants