This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients scoder, serhiy.storchaka, vstinner
Date 2016-08-22.23:30:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1471908622.19.0.737337965832.issue27830@psf.upfronthosting.co.za>
In-reply-to
Content
Here is a first patch:

* Add _PyObject_FastCallKeywords(): main entry point
* Add _PyCFunction_FastCallKeywords(): implementation for C function, but currently it's just an empty skeleton
* Rename fast_function() to PyFunction_FastCallKeywords() and ajust its API

In this first implementation, _PyObject_FastCallKeywords() has a full implementation for Python function, otherwise it only uses _PyObject_FastCallDict() fast path if the function has no keyword argument. In the last resort, it creates a temporary tuple and maybe also a temporary dict, to call PyObject_Call().

To test the patch, I modified do_call() to call _PyObject_FastCallKeywords(). I'm not sure that it makes sense in term of performance at this stage.

Serhiy: You can use this first implementation to experimental for fast argument parser for keyword arguments passed as (key, value) pairs ;-)
History
Date User Action Args
2016-08-22 23:30:22vstinnersetrecipients: + vstinner, scoder, serhiy.storchaka
2016-08-22 23:30:22vstinnersetmessageid: <1471908622.19.0.737337965832.issue27830@psf.upfronthosting.co.za>
2016-08-22 23:30:22vstinnerlinkissue27830 messages
2016-08-22 23:30:22vstinnercreate