Issue 31472: "Emulating callable objects" documentation misleading
Created on 2017-09-14 17:25 by nmarrow, last changed 2022-04-11 14:58 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| 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). |
|||
| msg395292 - (view) | Author: Andrei Kulakov (andrei.avk) * ![]() |
Date: 2021-06-07 22:33 | |
I don't think the docs in current form imply keyword args are disallowed: "arguments" covers both positional and keyword args, and the call as given in example would work for both positional and keyword args (though not overriding the default value of an arg). It seems to me this can be closed. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:52 | admin | set | github: 75653 |
| 2022-01-14 18:00:27 | iritkatriel | set | status: open -> closed resolution: works for me stage: resolved |
| 2021-06-07 22:33:56 | andrei.avk | set | nosy:
+ andrei.avk messages: + msg395292 |
| 2021-03-14 18:04:39 | kamilturek | set | nosy:
+ kamilturek |
| 2021-03-14 17:26:40 | iritkatriel | set | keywords:
+ 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:03 | nmarrow | create | |
