[issue15125] argparse: positional arguments containing - in name not handled well

Éric Araujo report at bugs.python.org
Mon Jul 9 07:00:02 CEST 2012


Éric Araujo <merwok at netwok.org> added the comment:

Isn’t the obvious workaround to pass a dest argument which is a valid identifier?  add_argument('spam-eggs', dest='spam_eggs')

Maybe argparse in 3.4 could do this transformation automatically (see how namedtuple converts anything to valid identifiers).

----------
nosy: +eric.araujo

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


More information about the Python-bugs-list mailing list