From: Berker Peksag Date: Sat, 5 Mar 2016 12:05:45 +0000 (+0200) Subject: Issue #17940: Remove redundant code from _Section.format_help() X-Git-Tag: v3.6.0a1~530 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=841b930a41be90c6c05fb4bab8392f50e01d86b7;p=python Issue #17940: Remove redundant code from _Section.format_help() Output of func(*args) stored in the next line: item_help = join([func(*args) for func, args in self.items]) _Section.items only used by HelpFormatter._add_item() and it looks like it doesn't have any side effects. Patch by Yogesh Chaudhari. --- diff --git a/Lib/argparse.py b/Lib/argparse.py index cc538415d2..209b4e99c1 100644 --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -210,8 +210,6 @@ class HelpFormatter(object): if self.parent is not None: self.formatter._indent() join = self.formatter._join_parts - for func, args in self.items: - func(*args) item_help = join([func(*args) for func, args in self.items]) if self.parent is not None: self.formatter._dedent()