[Python-checkins] Indicate that abs() method accept argument that implement __abs__(), just like call() method in the docs (GH-20509)

Windson yang webhook-mailer at python.org
Fri May 29 07:35:42 EDT 2020


https://github.com/python/cpython/commit/28316422124206f63ddd4b91f2e19c54b6e9cd9d
commit: 28316422124206f63ddd4b91f2e19c54b6e9cd9d
branch: master
author: Windson yang <wiwindson at outlook.com>
committer: GitHub <noreply at github.com>
date: 2020-05-29T07:35:34-04:00
summary:

Indicate that abs() method accept argument that implement __abs__(), just like call() method in the docs (GH-20509)

files:
M Doc/library/functions.rst

diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 90a2370c1793b..e9c92f7c8210d 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -43,9 +43,8 @@ are always available.  They are listed here in alphabetical order.
 .. function:: abs(x)
 
    Return the absolute value of a number.  The argument may be an
-   integer or a floating point number.  If the argument is a complex number, its
-   magnitude is returned. If *x* defines :meth:`__abs__`,
-   ``abs(x)`` returns ``x.__abs__()``.
+   integer, a floating point number, or an object implementing :meth:`__abs__`.
+   If the argument is a complex number, its magnitude is returned.
 
 
 .. function:: all(iterable)



More information about the Python-checkins mailing list