]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Indicate that abs() method accept argument that implement __abs__(), just like call...
authorWindson yang <wiwindson@outlook.com>
Fri, 29 May 2020 11:35:34 +0000 (19:35 +0800)
committerGitHub <noreply@github.com>
Fri, 29 May 2020 11:35:34 +0000 (07:35 -0400)
Doc/library/functions.rst

index 90a2370c1793bb0635bccbe6b0f4184813c6a2dd..e9c92f7c8210d16135ccd72353182786358c70ea 100644 (file)
@@ -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)