Skip to content

Commit 2831642

Browse files
authored
Indicate that abs() method accept argument that implement __abs__(), just like call() method in the docs (GH-20509)
1 parent 21017ed commit 2831642

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Doc/library/functions.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +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. If *x* defines :meth:`__abs__`,
48-
``abs(x)`` returns ``x.__abs__()``.
46+
integer, a floating point number, or an object implementing :meth:`__abs__`.
47+
If the argument is a complex number, its magnitude is returned.
4948

5049

5150
.. function:: all(iterable)

0 commit comments

Comments
 (0)