[issue6044] Exception message in int() when trying to convert a complex

2009-05-17 Thread Mark Dickinson
Mark Dickinson added the comment: Removed "; use int(abs(z))" from the error message (and the corresponding pieces from the error messages for long(z) and float(z)) in r72718, r72719, r72720, r72722. (Georg agreed to this change in a brief discussion on IRC.) -- resolution: invalid ->

[issue6044] Exception message in int() when trying to convert a complex

2009-05-17 Thread Mark Dickinson
Mark Dickinson added the comment: I always found the "use int(abs(z))" part of that message odd, as well. As Georg points out, there are many possible ways that one might want to convert complex to int; it seems strange to give advice for one particular one when that may well not match what th

[issue6044] Exception message in int() when trying to convert a complex

2009-05-17 Thread Georg Brandl
Georg Brandl 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 absolut

[issue6044] Exception message in int() when trying to convert a complex

2009-05-16 Thread aletornw
New submission from aletornw : Hi, I noticed that when trying to convert with the int() function a complex number the exception error says "use int(abs(z))". I think that insted it should say "use int(z.real)" because if I want to convert 1j**2 to int using the abs method, the result is 1 positiv