mirror of
https://github.com/python/cpython.git
synced 2025-08-25 19:24:42 +00:00
gh-125542: Deprecate prefix_chars in ArgumentParser.add_argument_group() (GH-125563)
This commit is contained in:
parent
624be8699a
commit
7b04496e5c
6 changed files with 52 additions and 2 deletions
|
@ -1662,6 +1662,14 @@ class _ActionsContainer(object):
|
|||
class _ArgumentGroup(_ActionsContainer):
|
||||
|
||||
def __init__(self, container, title=None, description=None, **kwargs):
|
||||
if 'prefix_chars' in kwargs:
|
||||
import warnings
|
||||
depr_msg = (
|
||||
"The use of the undocumented 'prefix_chars' parameter in "
|
||||
"ArgumentParser.add_argument_group() is deprecated."
|
||||
)
|
||||
warnings.warn(depr_msg, DeprecationWarning, stacklevel=3)
|
||||
|
||||
# add any missing keyword arguments by checking the container
|
||||
update = kwargs.setdefault
|
||||
update('conflict_handler', container.conflict_handler)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue