Message170364
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. |
|
Date |
User |
Action |
Args |
2012-09-12 10:39:03 | bethard | set | recipients:
+ bethard, r.david.murray, brmzkw |
2012-09-12 10:39:03 | bethard | set | messageid: <1347446343.61.0.429676960409.issue15929@psf.upfronthosting.co.za> |
2012-09-12 10:38:42 | bethard | link | issue15929 messages |
2012-09-12 10:38:42 | bethard | create | |
|