[Python-Dev] return type of __complex__

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Oct 22 02:10:13 CEST 2012


Steven D'Aprano wrote:

> When you're dealing with numbers that represent real quantities, getting
> a complex result is nearly always an error condition. Better to get an
> exception at the point that occurs, than somewhere distant when the number
> gets fed to %f formatting, or worse, no error at all, just a silently
> generating garbage results.

Yeah. I don't think Inland Revenue would be very impressed if
I tried to tell them I had imaginary tax-to-pay, advantageous
though it might be for me.

-- 
Greg


More information about the Python-Dev mailing list