[Python-Dev] PEP 590 discussion (original) (raw)
Mark Shannon mark at hotpy.org
Sat Apr 27 05:19:15 EDT 2019
- Previous message (by thread): [Python-Dev] PEP 590 discussion
- Next message (by thread): [Python-Dev] PEP 580/590 discussion
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Jeroen,
On 15/04/2019 9:38 am, Jeroen Demeyer wrote:
On 2019-04-14 13:30, Mark Shannon wrote:
PYVECTORCALLARGUMENTSOFFSET 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 tpnew and tpinit take the "cls" and "self" as separate arguments, not as part of *args. So I don't see why you need PYVECTORCALLARGUMENTSOFFSET for this.
Here's some (untested) code for an implementation of vectorcall for object subtypes implemented in Python. It uses PY_VECTORCALL_ARGUMENTS_OFFSET to save memory allocation when calling the init method.
Cheers, Mark.
- Previous message (by thread): [Python-Dev] PEP 590 discussion
- Next message (by thread): [Python-Dev] PEP 580/590 discussion
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]