Hi Jeroen, On 15/04/2019 9:38 am, Jeroen Demeyer wrote: > 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. 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. https://github.com/python/cpython/commit/9ff46e3ba0747f386f9519933910d63d5caae6ee#diff-c3cf251f16d5a03a9e7d4639f2d6f998R3820 Cheers, Mark.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4