[Python-Dev] PEP 590 discussion
Jeroen Demeyer
J.Demeyer at UGent.be
Mon Apr 15 04:38:11 EDT 2019
More information about the Python-Dev mailing list
Mon Apr 15 04:38:11 EDT 2019
- Previous message (by thread): [Python-Dev] PEP 590 discussion
- Next message (by thread): [Python-Dev] PEP 590 discussion
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 2019-04-14 13:30, Mark Shannon wrote: > PY_VECTORCALL_ARGUMENTS_OFFSET exists so that callables that make onward > calls with an additional argument can do so efficiently. The obvious > example is bound-methods, but classes are at least as important. > cls(*args) -> cls.new(cls, *args) -> cls.__init__(self, *args) But tp_new and tp_init take the "cls" and "self" as separate arguments, not as part of *args. So I don't see why you need PY_VECTORCALL_ARGUMENTS_OFFSET for this. > The updated minimal implementation now uses `const` arguments. > Code that uses args[-1] must explicitly cast away the const. > https://github.com/markshannon/cpython/blob/vectorcall-minimal/Objects/classobject.c#L55 That's better indeed. Jeroen.
- Previous message (by thread): [Python-Dev] PEP 590 discussion
- Next message (by thread): [Python-Dev] PEP 590 discussion
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list