From 8e806cb7ed9b7e35d4dfcef807b058df746eaa0e Mon Sep 17 00:00:00 2001 From: donbarbos Date: Fri, 16 May 2025 20:07:08 +0400 Subject: [PATCH 1/2] gh-134082: Modernize docstrings in `ArgumentParser.parse_known_intermixed_args` --- Lib/argparse.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Lib/argparse.py b/Lib/argparse.py index f688c38d0d1ae5..5ba0dfb8d1dbeb 100644 --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -2562,13 +2562,13 @@ def parse_intermixed_args(self, args=None, namespace=None): return args def parse_known_intermixed_args(self, args=None, namespace=None): - # returns a namespace and list of extras - # - # positional can be freely intermixed with optionals. optionals are - # first parsed with all positional arguments deactivated. The 'extras' - # are then parsed. If the parser definition is incompatible with the - # intermixed assumptions (e.g. use of REMAINDER, subparsers) a - # TypeError is raised. + """ + Return a namespace and list of extras positional can be freely + intermixed with optionals. optionals are first parsed with all + positional arguments deactivated. The 'extras' are then parsed. + If the parser definition is incompatible with the intermixed + assumptions (e.g. use of REMAINDER, subparsers) a TypeError is raised. + """ positionals = self._get_positional_actions() a = [action for action in positionals From a750e75a3d36500014a520eb5b832f532f5979f7 Mon Sep 17 00:00:00 2001 From: donbarbos Date: Fri, 16 May 2025 20:34:57 +0400 Subject: [PATCH 2/2] Capitalize letter --- Lib/argparse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/argparse.py b/Lib/argparse.py index 5ba0dfb8d1dbeb..11f5959ece2f36 100644 --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -2564,7 +2564,7 @@ def parse_intermixed_args(self, args=None, namespace=None): def parse_known_intermixed_args(self, args=None, namespace=None): """ Return a namespace and list of extras positional can be freely - intermixed with optionals. optionals are first parsed with all + intermixed with optionals. Optionals are first parsed with all positional arguments deactivated. The 'extras' are then parsed. If the parser definition is incompatible with the intermixed assumptions (e.g. use of REMAINDER, subparsers) a TypeError is raised. pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy