FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-142928: Add deprecation warning for removal of `color` on `HelpFormatter` by savannahostrowski · Pull Request #142946 · python/cpython · GitHub

/ cpython Public

GH-142928: Add deprecation warning for removal of color on HelpFormatter - #142946

Closed
savannahostrowski wants to merge 4 commits into
python:mainfrom
savannahostrowski:deprecation-warning-color
Closed

GH-142928: Add deprecation warning for removal of color on HelpFormatter#142946
savannahostrowski wants to merge 4 commits into
python:mainfrom
savannahostrowski:deprecation-warning-color

Conversation

savannahostrowski commented Dec 18, 2025
edited
Loading

Copy link
Copy Markdown
Member

Never documented and buggy but alas, still used, so we need a deprecation warning. More context here: #142274 (comment)

hroncok commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

Thanks. Should this still attempt to call self._set_color(color) in this case? Or else if it cannot, say "deprecated and does nothing" in the warning/docs?

Comment thread Doc/whatsnew/3.15.rst

* :mod:`argparse`:

* The *color* parameter of :class:`~argparse.HelpFormatter` is deprecated.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It's undocumented, fix the Sphinx warning:

Suggested change
* The *color* parameter of :class:`~argparse.HelpFormatter` is deprecated.
* The *color* parameter of :class:`!HelpFormatter` is deprecated.

@@ -0,0 +1 @@
Deprecate :class:`~argparse.HelpFormatter`'s *color* parameter. Users should use the *color* parameter on :class:`~argparse.ArgumentParser` instead.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
Deprecate :class:`~argparse.HelpFormatter`'s *color* parameter. Users should use the *color* parameter on :class:`~argparse.ArgumentParser` instead.
Deprecate :class:`!HelpFormatter`'s *color* parameter. Use the *color* parameter on :class:`~argparse.ArgumentParser` instead.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL