[Python-Dev] return type of __complex__

Greg Ewing greg.ewing at canterbury.ac.nz
Sun Oct 21 08:05:40 CEST 2012


Chris Angelico wrote:
> Python 2 (future directives aside) also required you to explicitly ask
> for floating point. That was also changed in Python 3.

The solution adopted was different, though: use different
operators for int and float division. This means you can't
accidentally end up with a float when an int is what you
intended.

The equivalent solution here would be to add a new operator
for complex exponentiation that coerces its operands to
complex, and restrict the existing one to floats only.

-- 
Greg


More information about the Python-Dev mailing list