[docs] [issue25299] TypeError: __init__() takes at least 4 arguments (4 given)

R. David Murray report at bugs.python.org
Fri Oct 2 16:55:15 CEST 2015


R. David Murray added the comment:

Yes, the python2 TypeErrors for mimatched arguments are sub-optimal.  This has been fixed in python3:

>>> parser.add_argument('--foo', help="foo", action='store_const')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/rdmurray/python/p36/Lib/argparse.py", line 1336, in add_argument
    action = action_class(**kwargs)
TypeError: __init__() missing 1 required positional argument: 'const'

----------
nosy: +r.david.murray
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25299>
_______________________________________


More information about the docs mailing list