classification
Title: "Emulating callable objects" documentation misleading
Type: Stage:
Components: Documentation Versions: Python 3.7, Python 3.6, Python 3.5, Python 3.3, Python 3.4, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, nmarrow
Priority: normal Keywords:

Created on 2017-09-14 17:25 by nmarrow, last changed 2017-09-14 17:25 by nmarrow.

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
2017-09-14 17:25:03nmarrowcreate