diff options
author | Windson yang <wiwindson@outlook.com> | 2020-05-29 11:35:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-29 11:35:34 (GMT) |
commit | 28316422124206f63ddd4b91f2e19c54b6e9cd9d (patch) | |
tree | 08702abe4904b750e379a064cc1394003f9ffef1 /Doc | |
parent | 21017ed904f734be9f195ae1274eb81426a9e776 (diff) | |
download | cpython-28316422124206f63ddd4b91f2e19c54b6e9cd9d.zip cpython-28316422124206f63ddd4b91f2e19c54b6e9cd9d.tar.gz cpython-28316422124206f63ddd4b91f2e19c54b6e9cd9d.tar.bz2 |
Indicate that abs() method accept argument that implement __abs__(), just like call() method in the docs (GH-20509)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/functions.rst | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 90a2370..e9c92f7 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) |