gh-126676: Expand argparse docs for type=bool with warning and alternatives#146435
Conversation
savannahostrowski
left a comment
There was a problem hiding this comment.
Thanks for taking a look at this. Left a comment about trying to be more concise!
|
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. Removed the warning admonition and condensed the alternatives to a single line pointing to |
|
Thanks for making the requested changes! @savannahostrowski: please review the changes made to this pull request. |
|
Thanks @joshuaswanson for the PR, and @savannahostrowski for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
…alternatives (pythonGH-146435) (cherry picked from commit 80d0a85) Co-authored-by: Joshua Swanson <22283299+joshuaswanson@users.noreply.github.com> Co-authored-by: joshuaswanson <joshuaswanson@users.noreply.github.com> Co-authored-by: Savannah Ostrowski <savannah@python.org>
…alternatives (pythonGH-146435) (cherry picked from commit 80d0a85) Co-authored-by: Joshua Swanson <22283299+joshuaswanson@users.noreply.github.com> Co-authored-by: joshuaswanson <joshuaswanson@users.noreply.github.com> Co-authored-by: Savannah Ostrowski <savannah@python.org>
|
GH-148048 is a backport of this pull request to the 3.14 branch. |
|
GH-148049 is a backport of this pull request to the 3.13 branch. |
… alternatives (GH-146435) (#148049) gh-126676: Expand argparse docs for type=bool with warning and alternatives (GH-146435) (cherry picked from commit 80d0a85) Co-authored-by: Joshua Swanson <22283299+joshuaswanson@users.noreply.github.com> Co-authored-by: joshuaswanson <joshuaswanson@users.noreply.github.com> Co-authored-by: Savannah Ostrowski <savannah@python.org>
… alternatives (GH-146435) (#148048) gh-126676: Expand argparse docs for type=bool with warning and alternatives (GH-146435) (cherry picked from commit 80d0a85) Co-authored-by: Joshua Swanson <22283299+joshuaswanson@users.noreply.github.com> Co-authored-by: joshuaswanson <joshuaswanson@users.noreply.github.com> Co-authored-by: Savannah Ostrowski <savannah@python.org>
Replace the brief
type=boolnote with a.. warning::admonition that demonstrates the surprising behavior ('False'->True), and add three recommended alternatives:BooleanOptionalAction,store_true/store_false, and a custom converter function.Addresses the request in #126676 (comment) for documenting "recipes/patterns to achieve the desired result." This is a docs-only change with no runtime behavior modifications.