Message291348
The magical no-argument call could also be clarified:
8. Define in the main text what happens when you omit the first argument (the subclass) to “super”. At the moment, I think the reader could infer that it is the method’s class, but this is only hinted by reading the comment in the illustration and Raymond’s external web page. The documentation should also clarify how it works, or at least be clear when it is not supported (e.g. one method assigned to multiple classes, functions defined outside a class definition, decorators that re-create the class, “super” renamed).
9. The no-argument call creates an instance bound to the first argument of the method, not an unbound instance. Determining the “self” argument is also magical: it does not seem to work with default arguments, variable positional arguments, nor keyword-only arguments. List comprehensions, generator expressions, etc seem to override it, and the argument is not seen by exec and eval. |
|
Date |
User |
Action |
Args |
2017-04-09 00:16:35 | martin.panter | set | recipients:
+ martin.panter, rhettinger, r.david.murray, docs@python, Tapani Kiiskinen |
2017-04-09 00:16:35 | martin.panter | set | messageid: <1491696995.46.0.285442537637.issue23674@psf.upfronthosting.co.za> |
2017-04-09 00:16:35 | martin.panter | link | issue23674 messages |
2017-04-09 00:16:33 | martin.panter | create | |
|