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

optparse: Improve Option typing #13282

Merged
merged 2 commits into from
Dec 23, 2024
Merged

Conversation

hamdanal
Copy link
Contributor

No description provided.

This comment has been minimized.

stdlib/optparse.pyi Show resolved Hide resolved
choices: list[str] | tuple[str, ...] | None = None,
# TODO: callback, callback_args, callback_kwargs must be all supplied or all omitted. Add overloads.
# Revisit if ParamSpec is ever changed to support non-unpacked args and kwargs.
callback: Callable[..., Incomplete] | None = None,
Copy link
Member

Choose a reason for hiding this comment

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

Should these Incompletes be Any as the correct type cannot currently be represented in the type system?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe. Let’s change it later, after I have done some testing. I’m not done with optparse yet.

Co-authored-by: Jelle Zijlstra <[email protected]>
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@JelleZijlstra JelleZijlstra merged commit 1de7826 into python:main Dec 23, 2024
63 checks passed
@hamdanal hamdanal deleted the optparse.Option branch December 23, 2024 17:34
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.

2 participants