Skip to content

Commit 7079b30

Browse files
committed
Indicate that abs() method accept argument that implement __abs__(), just like call() method in the docs
1 parent b36b0a3 commit 7079b30

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/library/functions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ are always available. They are listed here in alphabetical order.
4343
.. function:: abs(x)
4444

4545
Return the absolute value of a number. The argument may be an
46-
integer or a floating point number. If the argument is a complex number, its
47-
magnitude is returned.
46+
integer or a floating point number, If *x* defines :meth:`__abs__`,
47+
``abs(x)`` returns ``x.__abs__()``. If the argument is a complex number, its magnitude is returned.
4848

4949

5050
.. function:: all(iterable)

0 commit comments

Comments
 (0)