[issue6044] Exception message in int() when trying to convert a complex
report at bugs.python.org
Sun May 17 11:21:07 CEST 2009
Georg Brandl <georg at python.org> added the comment:
That no unambiguous conversion between complex and int is defined is
exactly the reason for this error message. You could want the absolute
value, the real part, the imaginary part, or even the polar angle...
int(abs(z)) works as intended, giving you the absolute value of the
complex number, which is 1 for 1j**2.
resolution: -> invalid
status: open -> closed
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list