This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: extra code in argparse.py
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Yogesh.Chaudhari, aho, berker.peksag, bethard, paul.j3, python-dev, tshepang
Priority: normal Keywords: patch

Created on 2013-05-08 22:32 by aho, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue17940.patch Yogesh.Chaudhari, 2013-05-11 10:20 review
issue17940-27.patch Yogesh.Chaudhari, 2013-05-11 10:26 Patch for 2.7 branch review
Messages (8)
msg188742 - (view) Author: Alex (aho) Date: 2013-05-08 22:32
In class HelpFormatter, class _Section, format_help(self)
(lines 199 & 200), the two lines

            for func, args in self.items:
                func(*args)

aren't necessary; the results of func are ignored.
"func" is applied (again) on the next line when the
output is joined into item_help.

Cheers
.a
msg188902 - (view) Author: Yogesh Chaudhari (Yogesh.Chaudhari) * Date: 2013-05-11 10:20
Removed the duplicated code from argparse.py
msg188903 - (view) Author: Yogesh Chaudhari (Yogesh.Chaudhari) * Date: 2013-05-11 10:26
Remove extra code in argparse.py for 2.7 branch
msg188904 - (view) Author: Yogesh Chaudhari (Yogesh.Chaudhari) * Date: 2013-05-11 10:27
I have added a patch for default branch as well, because IMO the same issue exists in all branches
msg188985 - (view) Author: Yogesh Chaudhari (Yogesh.Chaudhari) * Date: 2013-05-12 06:59
I guess that was simple enough. I am new to this issue tracker for Cpython. How will the patch review/commit proceed?
msg189084 - (view) Author: paul j3 (paul.j3) * (Python triager) Date: 2013-05-13 00:24
I was wondering about that block of code earlier.

It would be a good idea to look at what func() does, just to make sure there aren't any side effects - e.g. set maximum line length, required indention, etc.
msg261213 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-03-05 12:06
New changeset be3874cf87f3 by Berker Peksag in branch 'default':
Issue #17940: Remove redundant code from _Section.format_help()
https://hg.python.org/cpython/rev/be3874cf87f3
msg261214 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-03-05 12:06
Thanks!
History
Date User Action Args
2022-04-11 14:57:45adminsetgithub: 62140
2016-03-05 12:06:40berker.peksagsetstatus: open -> closed

versions: + Python 3.6, - Python 3.4
nosy: + berker.peksag

messages: + msg261214
resolution: fixed
stage: patch review -> resolved
2016-03-05 12:06:07python-devsetnosy: + python-dev
messages: + msg261213
2013-06-29 00:01:15berker.peksagsetstage: needs patch -> patch review
versions: + Python 3.4, - Python 2.7
2013-05-13 00:24:51paul.j3setnosy: + paul.j3
messages: + msg189084
2013-05-12 21:35:24Yogesh.Chaudharisethgrepos: - hgrepo190
2013-05-12 06:59:36Yogesh.Chaudharisetmessages: + msg188985
2013-05-11 10:27:54Yogesh.Chaudharisetmessages: + msg188904
2013-05-11 10:26:23Yogesh.Chaudharisetfiles: + issue17940-27.patch
hgrepos: + hgrepo190
messages: + msg188903
2013-05-11 10:20:37Yogesh.Chaudharisetfiles: + issue17940.patch

nosy: + Yogesh.Chaudhari
messages: + msg188902

keywords: + patch
2013-05-10 18:19:03tshepangsetnosy: + tshepang
2013-05-10 17:59:47ezio.melottisetnosy: + bethard

stage: needs patch
2013-05-08 22:32:30ahocreate