STINNER Victor added the comment:

Ok, I pushed a new commit "Add Py_TPFLAGS_HAVE_FASTCALL flag" in my Git branch.

(By the way, I'm using the Git branch as a working copy, it can change anytime 
to get a nice list of commits. If you want reliable changes, use patches 
attached to this issue.)


Serhiy Storchaka!:
> For compatibility with extensions built with older Pythons you should define 
> new type flag and read tp_fastcall only if the flag is set. See for example 
> Py_TPFLAGS_HAVE_FINALIZE.

Wait, there is maybe an issue with the stable API in my design :-/

Let's say that a builtin type NEW defines tp_fastcall and uses 
fastcall_wrapper() for tp_call. A type OLD inherits from NEW and don't override 
tp_call (not tp_fastcall). Type OLD comes from an extension compiled with 
Python 3.6 and use the stable ABI. Does the type OLD contain the field 
tp_fastcall in memory? Is it possible to copy the tp_fastcall filed from type 
NEW into the type OLD?

If not, the fastcall_wrapper() should be smarter to not get tp_fastcall from 
the type OLD but follow the MRO to find the first type with the 
Py_TPFLAGS_HAVE_FASTCALL flag. Is it possible that this short loop to find has 
a cost on performances?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29259>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to