[Freeipa-devel] Integer parameters
John Dennis
jdennis at redhat.com
Sat Oct 17 15:04:28 UTC 2009
I wanted to assure myself if a command was expecting an integer value,
it could be input in whatever radix the user desires and be correctly
converted. If I understand correctly this code is in parameters.py and
is implemented by the _convert_scalar member function. The Int and Float
classes derive from the Number class and inherit Number._convert_scalar
which attempts to call the type (e.g. constructor). However the int
class only supports base 10 radix strings in it's constructor, it will
not do radix conversion. Shouldn't the Int parameter class have it's own
_convert_scalar which invokes int(value, 0)? (Note: the second argument
to the int constructor is the radix base, with 0 being a special value
indicating the radix is to be derived from the prefix)
--
John Dennis <jdennis at redhat.com>
Looking to carve out IT costs?
www.redhat.com/carveoutcosts/
More information about the Freeipa-devel
mailing list