Arnaud Fontaine <[email protected]> added the comment:
> Could you add a test to verify that custom actions are still getting
> the converted values passed to their __call__? I suspect this may not
> be happening under the current patch - if that's the case, you may
> also need to add conversions in _get_values, where the lines look like
> "value = action.default".
There seems to be already a test for that, namely TestActionUserDefined,
which use type=float and type=int. The value is properly converted to
{int,float} when passed to __call__(). Just in case, I also tested with
a 'type' function I defined myself (which only returns float()) for
OptionalAction and it's working fine.
> Also, "action.default == getattr(namespace, action.dest)" should
> probably use "is" instead of "==".
Good point, it would be much better. Thanks for the advice. I have just
modified the patch with that.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue12776>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com