We're back after a server migration that caused effbot.org to fall over a bit harder than expected. Expect some glitches.

abs

abs(x)

Returns the absolute value of a number. The argument may be a plain or long integer or a floating point number. If the argument is a complex number, its magnitude is returned.

To make this function work on your own classes, implement the __abs__ method.