Skip to content

gh-136032: Fix argparse.BooleanOptionalAction doc #136133

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mattwang44
Copy link
Contributor

@mattwang44 mattwang44 commented Jun 30, 2025

@mattwang44 mattwang44 force-pushed the fix-argparse-BooleanOptionalAction-doc branch from 075b1c9 to e4b9fd5 Compare June 30, 2025 14:57
Note that only actions that consume command-line arguments (e.g. ``'store'``,
``'append'`` or ``'extend'``) can be used with positional arguments. You may
also specify an arbitrary action by passing an :class:`Action` subclass or
other object that implements the same interface.

.. class:: BooleanOptionalAction
Copy link
Contributor Author

@mattwang44 mattwang44 Jun 30, 2025

Choose a reason for hiding this comment

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

or maybe move BooleanOptionalAction paragraph to "Action classes" section?

Copy link
Member

Choose a reason for hiding this comment

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

Actually, I think this is a good idea. Right now, I think that BooleanOptionalAction gets kind of buried in the long list of action type arguments. It probably makes more sense in Action proper.

Copy link
Member

@savannahostrowski savannahostrowski left a comment

Choose a reason for hiding this comment

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

Thanks for this PR. I think your suggestion to move BooleanOptionalAction is solid. Wording is also great, just one small comment

Comment on lines 842 to 846
Note that only actions that consume command-line arguments (e.g. ``'store'``,
``'append'`` or ``'extend'``) can be used with positional arguments. You may
also specify an arbitrary action by passing an :class:`Action` subclass or
other object that implements the same interface.

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Note that only actions that consume command-line arguments (e.g. ``'store'``,
``'append'`` or ``'extend'``) can be used with positional arguments. You may
also specify an arbitrary action by passing an :class:`Action` subclass or
other object that implements the same interface.
Only actions that consume command-line arguments (e.g. ``'store'``,
``'append'`` or ``'extend'``) can be used with positional arguments. You may
also specify an arbitrary action by passing an :class:`Action` subclass or
other object that implements the same interface.

Note that only actions that consume command-line arguments (e.g. ``'store'``,
``'append'`` or ``'extend'``) can be used with positional arguments. You may
also specify an arbitrary action by passing an :class:`Action` subclass or
other object that implements the same interface.

.. class:: BooleanOptionalAction
Copy link
Member

Choose a reason for hiding this comment

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

Actually, I think this is a good idea. Right now, I think that BooleanOptionalAction gets kind of buried in the long list of action type arguments. It probably makes more sense in Action proper.

@bedevere-app
Copy link

bedevere-app bot commented Jul 1, 2025

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@mattwang44
Copy link
Contributor Author

I have made the requested changes; please review again

@bedevere-app
Copy link

bedevere-app bot commented Jul 1, 2025

Thanks for making the requested changes!

@savannahostrowski: please review the changes made to this pull request.

@bedevere-app bedevere-app bot requested a review from savannahostrowski July 1, 2025 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

2 participants