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

Appearance settings

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

Closed
savannahostrowski wants to merge 4 commits into
python:mainpython/cpython:mainfrom
savannahostrowski:deprecation-warning-colorsavannahostrowski/cpython:deprecation-warning-colorCopy head branch name to clipboard
Closed

GH-142928: Add deprecation warning for removal of color on HelpFormatter#142946
savannahostrowski wants to merge 4 commits into
python:mainpython/cpython:mainfrom
savannahostrowski:deprecation-warning-colorsavannahostrowski/cpython:deprecation-warning-colorCopy head branch name to clipboard

Conversation

@savannahostrowski

@savannahostrowski savannahostrowski commented Dec 18, 2025

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

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.

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.

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.

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.