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

[3.14] gh-134109: Fix showing comments in pydoc output for argparse (GH-134110)#134112

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

Merged
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletionsLib/argparse.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -205,6 +205,7 @@ def _set_color(self, color):
# ===============================
# Section and indentation methods
# ===============================

def _indent(self):
self._current_indent += self._indent_increment
self._level += 1
Expand DownExpand Up@@ -256,6 +257,7 @@ def _add_item(self, func, args):
# ========================
# Message building methods
# ========================

def start_section(self, heading):
self._indent()
section = self._Section(self, self._current_section, heading)
Expand DownExpand Up@@ -299,6 +301,7 @@ def add_arguments(self, actions):
# =======================
# Help-formatting methods
# =======================

def format_help(self):
help = self._root_section.format_help()
if help:
Expand DownExpand Up@@ -1467,6 +1470,7 @@ def __init__(self,
# ====================
# Registration methods
# ====================

def register(self, registry_name, value, object):
registry = self._registries.setdefault(registry_name, {})
registry[value] = object
Expand All@@ -1477,6 +1481,7 @@ def _registry_get(self, registry_name, value, default=None):
# ==================================
# Namespace default accessor methods
# ==================================

def set_defaults(self, **kwargs):
self._defaults.update(kwargs)

Expand All@@ -1496,6 +1501,7 @@ def get_default(self, dest):
# =======================
# Adding argument actions
# =======================

def add_argument(self, *args, **kwargs):
"""
add_argument(dest, ..., name=value, ...)
Expand DownExpand Up@@ -1921,6 +1927,7 @@ def identity(string):
# =======================
# Pretty __repr__ methods
# =======================

def _get_kwargs(self):
names = [
'prog',
Expand All@@ -1935,6 +1942,7 @@ def _get_kwargs(self):
# ==================================
# Optional/Positional adding methods
# ==================================

def add_subparsers(self, **kwargs):
if self._subparsers is not None:
raise ValueError('cannot have multiple subparser arguments')
Expand DownExpand Up@@ -1988,6 +1996,7 @@ def _get_positional_actions(self):
# =====================================
# Command line argument parsing methods
# =====================================

def parse_args(self, args=None, namespace=None):
args, argv = self.parse_known_args(args, namespace)
if argv:
Expand DownExpand Up@@ -2582,6 +2591,7 @@ def parse_known_intermixed_args(self, args=None, namespace=None):
# ========================
# Value conversion methods
# ========================

def _get_values(self, action, arg_strings):
# optional argument produces a default when not present
if not arg_strings and action.nargs == OPTIONAL:
Expand DownExpand Up@@ -2681,6 +2691,7 @@ def _check_value(self, action, value):
# =======================
# Help-formatting methods
# =======================

def format_usage(self):
formatter = self._get_formatter()
formatter.add_usage(self.usage, self._actions,
Expand DownExpand Up@@ -2718,6 +2729,7 @@ def _get_formatter(self):
# =====================
# Help-printing methods
# =====================

def print_usage(self, file=None):
if file is None:
file = _sys.stdout
Expand All@@ -2739,6 +2751,7 @@ def _print_message(self, message, file=None):
# ===============
# Exiting methods
# ===============

def exit(self, status=0, message=None):
if message:
self._print_message(message, _sys.stderr)
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp