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.

Author bethard
Recipients bethard, brmzkw, r.david.murray
Date 2012-09-12.10:38:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1347446343.61.0.429676960409.issue15929@psf.upfronthosting.co.za>
In-reply-to
Content
If you need to get things that aren't valid Python identifiers, use vars() to get the dictionary:

http://docs.python.org/dev/library/argparse.html#the-namespace-object

Changing all non-alphanumeric characters to underscores would be a backwards incompatible change for argparse (it would break existing code). That means we'd need to have a long deprecation period before the change. I'm not sure it's really worth it for this feature when vars() already gives you what you need easily.

I'm therefore closing this a "won't fix", but if you feel really strongly that vars() doesn't solve your problem and you want to push through the long deprecation process, feel free to re-open.

@R. David Murray: I wouldn't worry about non-identifiers in an attribute dict. This has worked for ages, and changing this would be a seriously backwards incompatible change that couldn't be possible before Python 4.
History
Date User Action Args
2012-09-12 10:39:03bethardsetrecipients: + bethard, r.david.murray, brmzkw
2012-09-12 10:39:03bethardsetmessageid: <1347446343.61.0.429676960409.issue15929@psf.upfronthosting.co.za>
2012-09-12 10:38:42bethardlinkissue15929 messages
2012-09-12 10:38:42bethardcreate