Steven Bethard added the comment: 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. ---------- resolution: -> wont fix status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15929> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com