Message212243
| Author |
paul.j3 |
| Recipients |
John.Didion, bethard, manveru, paul.j3, xuanji |
| Date |
2014年02月26日.07:24:08 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1393399449.24.0.148703449699.issue11588@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
The addition of a simple decorator to the 'ArgumentParser' class, would simplify registering the tests:
def crosstest(self, func):
# decorator to facilitate adding these functions
name = func.__name__
self.register('cross_tests', name, func)
which would be used as:
@parser.crosstest
def pat_or_suf(parser, seen_actions, *args):
if 2==len(seen_actions.intersection([a_pat, a_suf])):
parser.error('only one of PATTERN and SUFFIX allowed') |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2014年02月26日 07:24:09 | paul.j3 | set | recipients:
+ paul.j3, bethard, xuanji, John.Didion, manveru |
| 2014年02月26日 07:24:09 | paul.j3 | set | messageid: <1393399449.24.0.148703449699.issue11588@psf.upfronthosting.co.za> |
| 2014年02月26日 07:24:09 | paul.j3 | link | issue11588 messages |
| 2014年02月26日 07:24:08 | paul.j3 | create |
|