Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GH-130645: Default to color help in argparse#136809

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
pablogsal wants to merge7 commits intopython:main
base:main
Choose a base branch
Loading
frompablogsal:main

Conversation

pablogsal
Copy link
Member

@pablogsalpablogsal commentedJul 19, 2025
edited by StanFromIreland
Loading

Colored help significantly improves readability and user experience by helping users visually group and separate different sections, options, and arguments. Modern terminals overwhelmingly support ANSI color codes, and most contemporary programming languages and CLI tools now default to colored output when appropriate.

This change aligns Python's argparse with current standards where color is the expected default behavior. Users find colored output particularly valuable for quickly scanning and understanding command-line help, as it creates natural visual hierarchy and reduces cognitive load when parsing complex option lists.

The existing color detection logic already gracefully falls back to plain text on unsupported terminals, ensuring backwards compatibility. Users who prefer monochrome output retain full control through standard terminal preferences and environment variables.

Copy link
Member

@StanFromIrelandStanFromIreland left a comment
edited
Loading

Choose a reason for hiding this comment

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

LGTM, I like these:-)

Requested color expert.I think this can be skip-news since there is no change to the content? I see there was a NEWS entry for the previous PR, it was general enough that we could put it under it if that is possible?

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Copy link
Contributor

@ambvambv left a comment

Choose a reason for hiding this comment

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

I can approve again if you really want me to.

Copy link
Member

@AA-TurnerAA-Turner left a comment

Choose a reason for hiding this comment

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

The rationale makes sense. My only concern would becmd.exe on Windows, where I've had bad experiences with ANSI codes before, but local testing demonstrates that things seem to be working.

A

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

@ambvambvambv approved these changes

@AA-TurnerAA-TurnerAA-Turner approved these changes

@StanFromIrelandStanFromIrelandStanFromIreland approved these changes

@savannahostrowskisavannahostrowskiAwaiting requested review from savannahostrowskisavannahostrowski is a code owner

@hugovkhugovkAwaiting requested review from hugovk

@erlend-aaslanderlend-aaslandAwaiting requested review from erlend-aaslanderlend-aasland is a code owner

@vstinnervstinnerAwaiting requested review from vstinner

@1st11st1Awaiting requested review from 1st1

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@pablogsal@ambv@AA-Turner@StanFromIreland@hugovk

[8]ページ先頭

©2009-2025 Movatter.jp