[Python-Dev] PEP 580/590 discussion (original) (raw)

Petr Viktorin encukou at gmail.com
Mon May 6 12:25:34 EDT 2019


On 5/6/19 3:43 AM, Jeroen Demeyer wrote:

On 2019-05-06 00:04, Petr Viktorin wrote:

- Single bound method class for all kinds of function classes: This would be a cleaner design, yes, but I don't see a pressing need. As PEP 579 says, "this is a compounding issue", not a goal. As I recall, that is the only major reason for CCALLDEFARG. Just a minor correction here: I guess that you mean CCALLSELFARG. The flag CCALLDEFARG is for passing the PyCCallDef* in PEP 580, which is mostly equivalent to passing the callable object in PEP 590. The signature of PEP 580 is func(const PyCCallDef *def, PyObject *self, PyObject *const *args, Pyssizet nargs, PyObject *kwnames) And with PEP 590 it is func(PyObject *callable, PyObject *const *args, Pyssizet nargs, PyObject *kwnames) with the additional special role for the PYVECTORCALLARGUMENTSOFFSET bit (which is meant to solve the problem of "self" in a different way).

I worded that badly, sorry.

From PEP 590's callable, the called function can get any of these if it needs to (and if they're stored somewhere). But you can't write generic code would get them from any callable.

If we're not going for the "single bound method class" idea, that is OK; def & self can be implementation details of the callables that need them.



More information about the Python-Dev mailing list