Skip to content

gh-126676: Expand argparse docs for type=bool with warning and alternatives#146435

Open
joshuaswanson wants to merge 1 commit intopython:mainfrom
joshuaswanson:fix/argparse-bool-docs
Open

gh-126676: Expand argparse docs for type=bool with warning and alternatives#146435
joshuaswanson wants to merge 1 commit intopython:mainfrom
joshuaswanson:fix/argparse-bool-docs

Conversation

@joshuaswanson
Copy link

@joshuaswanson joshuaswanson commented Mar 25, 2026

Replace the brief type=bool note 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants