classification
Title: "Emulating callable objects" documentation misleading
Type: Stage:
Components: Documentation Versions: Python 3.10, Python 3.9, Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, kamilturek, nmarrow
Priority: normal Keywords: easy

Created on 2017-09-14 17:25 by nmarrow, last changed 2021-03-14 18:04 by kamilturek.

Messages (1)
msg302185 - (view) Author: Nathan Marrow (nmarrow) Date: 2017-09-14 17:25
The documentation for emulating callable objects with __call__ seems to imply only positional arguments are supported. For instance, it says __call__ is "object.__call__(self[, args…])" and describes:

Called when the instance is “called” as a function; if this method is defined, x(arg1, arg2, ...) is a shorthand for x.__call__(arg1, arg2, ...).

When it should be something like (Not sure exactly what the syntax would be here):
"object.__call__(self[, args…] [,**kwargs...])"

Called when the instance is “called” as a function; if this method is defined, x(arg1, arg2, ..., arg3=arg3) is a shorthand for x.__call__(arg1, arg2, ..., arg3=arg3).
History
Date User Action Args
2021-03-14 18:04:39kamiltureksetnosy: + kamilturek
2021-03-14 17:26:40iritkatrielsetkeywords: + easy
versions: + Python 3.8, Python 3.9, Python 3.10, - Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7
2017-09-14 17:25:03nmarrowcreate