Message127582
| Author |
vdupras |
| Recipients |
vdupras |
| Date |
2011年01月31日.08:05:02 |
| SpamBayes Score |
1.163958e-08 |
| Marked as misclassified |
No |
| Message-id |
<1296461103.49.0.397676179483.issue11076@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Currently, there is no (documented) way to easily extract arguments in an argparse Namespace as a dictionary. This way, it would me easy to interface a function taking a lot of kwargs like this:
>>> args = parser.parse_args()
>>> my_function(**dict(args))
There's "_get_kwargs()" but it's a private undocumented method. I guess that making it public would be problematic because of the namespace pollution that would occur. That's why I'm proposing to make it iterable.
If it isn't rejected, I'd gladly work on the required patch. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年01月31日 08:05:03 | vdupras | set | recipients:
+ vdupras |
| 2011年01月31日 08:05:03 | vdupras | set | messageid: <1296461103.49.0.397676179483.issue11076@psf.upfronthosting.co.za> |
| 2011年01月31日 08:05:02 | vdupras | link | issue11076 messages |
| 2011年01月31日 08:05:02 | vdupras | create |
|