Message229990
Ned Deily: I don't quite know how to use unittest, but I'll try to look into it.
paul j3:
> There I proposed leaving '_negative_number_matcher' unchanged,
> but only use it to set '_has_negative_number_optionals'.
I don't know argparse internals but, if I understand your argument, I think you still need a '_negative_number_matcher' capable of correctly match any negative number in any form, including scientific notation, complex j, etc..
If this is the case, then, the matcher could be simplified to something like
'^-\d+|^-.\d+'
(notice $ removed from current regex) which would only signal that "something that starts like a negative number" is present.
Then one could use complex() or float() or whatever, to check that that's actually the case.
I would still expect an exception to be raised if, say, I specify type=float and then a complex value is passed as an argument. |
|
Date |
User |
Action |
Args |
2014-10-25 09:43:39 | jnespolo | set | recipients:
+ jnespolo, bethard, ned.deily, r.david.murray, paul.j3 |
2014-10-25 09:43:39 | jnespolo | set | messageid: <1414230219.3.0.603183248856.issue22672@psf.upfronthosting.co.za> |
2014-10-25 09:43:39 | jnespolo | link | issue22672 messages |
2014-10-25 09:43:38 | jnespolo | create | |
|