[capi-sig] Getting Numbers in C
Hrvoje Niksic
hniksic at xemacs.org
Sat Jul 21 09:59:48 CEST 2007
Campbell Barton <cbarton at metavr.com> writes:
>> If PyNumber_Float succeeds, but pyfloat turns out not to be float,
>> then the invalid argument exception is perfectly fine.
>
> Is this possible? - if its a number type I would have thaught it
> must be able to be converted to a float.
You're right, PyNumber_Float type-checks the return value of
tp_as_number->nb_float. I thought I had checked previously and had
seen otherwise, but I must have confused it with something else.
More information about the capi-sig
mailing list