Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stubtest: Private parameters can be omitted #16507

Merged
merged 12 commits into from
Feb 5, 2024

Conversation

srittau
Copy link
Contributor

@srittau srittau commented Nov 16, 2023

Fixes #16443

@srittau
Copy link
Contributor Author

srittau commented Nov 16, 2023

As opposed to what I suggested in the issue, I implemented it so the parameter name can start with at least one underscore. It doesn't require exactly one. I wouldn't be surprised if some people start their private parameter names with a double underscore.

CHANGELOG.md Outdated Show resolved Hide resolved
mypy/stubtest.py Outdated Show resolved Hide resolved
@AlexWaygood
Copy link
Member

As opposed to what I suggested in the issue, I implemented it so the parameter name can start with at least one underscore. It doesn't require exactly one. I wouldn't be surprised if some people start their private parameter names with a double underscore.

Hmm, until we dropped support for Python 3.7, typing_extensions had a lot of parameters that started with __ (to signify as best we could that they were meant to be positional-only). I don't think we necessarily considered them to be private parameters:

I think I preferred what was suggested in the issue: other packages might do similarly, and might not have updated their parameter names even if they've since dropped support for Python 3.7.

@srittau
Copy link
Contributor Author

srittau commented Nov 16, 2023

That's a good point. I'll update the PR.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@srittau
Copy link
Contributor Author

srittau commented Feb 5, 2024

Can I bump this PR? It seems there are no further objections.

@JelleZijlstra JelleZijlstra merged commit b956e6a into python:master Feb 5, 2024
14 checks passed
@srittau srittau deleted the stubtest-priv-args branch February 5, 2024 14:10
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] Ignore private arguments
3 participants