Skip to content

Commit d2fd649

Browse files
Windsooonmiss-islington
authored andcommitted
Indicate that abs() method accept argument that implement __abs__(), just like call() method in the docs (pythonGH-20509)
(cherry picked from commit 2831642) Co-authored-by: Windson yang <wiwindson@outlook.com>
1 parent 6637bd4 commit d2fd649

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Doc/library/functions.rst

+2-3
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)