https://github.com/python/cpython/commit/3ae2e33a61f8aebbe6ce16f1030687a6e66dbb72 commit: 3ae2e33a61f8aebbe6ce16f1030687a6e66dbb72 branch: master author: Windson yang <wiwindson at outlook.com> committer: Raymond Hettinger <rhettinger at users.noreply.github.com> date: 2018年07月05日T16:09:53-07:00 summary: classify abs() argument type (GH-8103) files: M Doc/library/functions.rst diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index f5427a4072a8..6476cbd65e01 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -44,7 +44,8 @@ are always available. They are listed here in alphabetical order. 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. + magnitude is returned. If *x* defines :meth:`__abs__`, + ``abs(x)`` returns ``x.__abs__()``. .. function:: all(iterable)