Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh-132558: add convert_choices parameter to add_argument #133826

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

Closed

Conversation

hansthen
Copy link

@hansthen hansthen commented May 10, 2025

Add an optional argument to convert_choices to the add_argument function. This allows users to specify both a type and choices and will ensure the choices are converted by the type callable before checking. This improves usage, help and error messages for the end-user.


📚 Documentation preview 📚: https://cpython-previews--133826.org.readthedocs.build/

@hansthen hansthen force-pushed the issue-132558-add-convert-to-action branch from 7fb5415 to afaa8ab Compare May 10, 2025 14:05
@hansthen hansthen force-pushed the issue-132558-add-convert-to-action branch from afaa8ab to b1be432 Compare May 10, 2025 14:08
@hansthen hansthen marked this pull request as ready for review May 10, 2025 16:33
@savannahostrowski
Copy link
Member

As I mentioned before, I don't think we should do this. I think we should aim improve the documentation since this will scale better. I will review that PR next.

@hansthen hansthen closed this May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants