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

This commit is contained in:
Windson yang 2020-05-29 19:35:34 +08:00 committed by GitHub
parent 21017ed904
commit 2831642212
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -43,9 +43,8 @@ are always available. They are listed here in alphabetical order.
.. function:: abs(x) .. function:: abs(x)
Return the absolute value of a number. The argument may be an 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 integer, a floating point number, or an object implementing :meth:`__abs__`.
magnitude is returned. If *x* defines :meth:`__abs__`, If the argument is a complex number, its magnitude is returned.
``abs(x)`` returns ``x.__abs__()``.
.. function:: all(iterable) .. function:: all(iterable)