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 positive, when it should be -1. With my method it works fine.
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.
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 the user wanted. I'd suggest just dropping the "use int(abs(z))" from the error message. I think it's more likely to be confusing than helpful. The same applies to float(complex).
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.)