This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: abs() method accept argument that implement __abs__()
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Windson Yang, docs@python, rhettinger
Priority: normal Keywords: patch

Created on 2018-07-05 06:44 by Windson Yang, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 8103 merged Windson Yang, 2018-07-05 08:04
Messages (4)
msg321080 - (view) Author: Windson Yang (Windson Yang) * Date: 2018-07-05 06:44
Just like callable() method in https://docs.python.org/3/library/functions.html#callable

> ...instances are callable if their class has a __call__() method.

I think we should also mention this in abs(),

abs(x)
Return the absolute value of a number. If x defines __abs__, abs(x) returns x.__abs__(). The argument may be an integer or a floating point number. If the argument is a complex number, its magnitude is returned.
msg321081 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2018-07-05 07:15
This is a reasonable request.  Would you like to make a PR?
msg321083 - (view) Author: Windson Yang (Windson Yang) * Date: 2018-07-05 08:09
I'd love to. (BTW, @rhettinger I just watched your fantastic multiprocessing tutorial. :D)
msg321141 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2018-07-05 23:10
Thanks
History
Date User Action Args
2022-04-11 14:59:02adminsetgithub: 78230
2018-07-05 23:10:25rhettingersetstatus: open -> closed
resolution: fixed
messages: + msg321141

stage: patch review -> resolved
2018-07-05 08:10:28Windson Yangsetassignee: docs@python

components: + Documentation, - Library (Lib)
nosy: + docs@python
2018-07-05 08:09:08Windson Yangsetmessages: + msg321083
2018-07-05 08:04:56Windson Yangsetkeywords: + patch
stage: patch review
pull_requests: + pull_request7697
2018-07-05 07:15:45rhettingersetnosy: + rhettinger
messages: + msg321081
2018-07-05 06:44:31Windson Yangcreate