Message238940
| Author |
paul.j3 |
| Recipients |
bethard, dongwm, paul.j3, r.david.murray |
| Date |
2015年03月22日.20:43:29 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1427057009.71.0.443641518995.issue23298@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
http://bugs.python.org/issue11588 is an earlier request for 'necessarily inclusive' groups.
The patches that I proposed there are more general, allowing for other logical combinations of arguments, as well as nesting groups. As such it is more complex than your patch, but the basic testing idea is the same -
At the end of _parse_known_args check the group's actions
against the ones that have been parsed. I use the existing
'seen_actions' or 'seen_nondefault_actions' rather than
check the namespace directly.
I also tried to construct this testing as a 'hook' that the user could customize.
Your test, since it uses the Namespace and Action default, rather than the 'seen_actions' set, could just as well be run AFTER parse_args. That's the kind of testing that Stackoverflow answers often suggest for similar questions.
In some cases it's also possible to write custom Action classes that handle this kind of interdependency. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2015年03月22日 20:43:29 | paul.j3 | set | recipients:
+ paul.j3, bethard, r.david.murray, dongwm |
| 2015年03月22日 20:43:29 | paul.j3 | set | messageid: <1427057009.71.0.443641518995.issue23298@psf.upfronthosting.co.za> |
| 2015年03月22日 20:43:29 | paul.j3 | link | issue23298 messages |
| 2015年03月22日 20:43:29 | paul.j3 | create |
|