classification
Title: Move new vector private declarations to the internal C API
Type: Stage: resolved
Components: Interpreter Core Versions: Python 3.9, Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: jdemeyer, vstinner
Priority: normal Keywords: patch

Created on 2019-06-07 11:54 by vstinner, last changed 2020-01-07 20:28 by ncoghlan. This issue is now closed.

Files
File name Uploaded Description Edit
stack_overflow-4.py vstinner, 2019-06-07 13:33
testcapi_call_no_args.patch vstinner, 2019-06-07 13:35
Pull Requests
URL Status Linked Edit
PR 13890 merged vstinner, 2019-06-07 12:05
PR 14156 merged vstinner, 2019-06-17 12:38
PR 14157 merged vstinner, 2019-06-17 13:02
PR 14158 merged vstinner, 2019-06-17 13:07
PR 14159 merged vstinner, 2019-06-17 13:28
PR 17893 petr.viktorin, 2020-01-07 17:54
Messages (10)
msg344927 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-06-07 11:54
bpo-37191: the new vector APIs declare "static inline" functions which are no C89 compatible and so cause compilation issues on pygobject3, python-dbus, xen (for example).

I propose to move the new *private* declarations to the internal C API.

I started to work on an application. The blocker issue is _PyObject_CallNoArg() which is now commonly used in CPython code base for best performances. It is used the _testcapi which must *not* be compiled with the internal C API.

So I suggest to first add a new public PyObject_CallNoArg() function. It would be different than _PyObject_CallNoArg() static inline function: PyObject_CallNoArg() would be a regular function and so fit better with ABI issues.
msg344929 - (view) Author: Jeroen Demeyer (jdemeyer) * (Python triager) Date: 2019-06-07 12:04
> I propose to move the new *private* declarations to the internal C API.

Some of those functions (in particular _PyObject_Vectorcall) are expected to become public in 3.9. They are only private for now since the API is provisional.
msg344936 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-06-07 13:35
I used testcapi_call_no_args.patch and stack_overflow-4.py to measure the stack consumption of PyObject_CallNoArgs() and PyObject_CallFunctionObjArgs() for PR 13890.
msg344960 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-06-07 16:14
Oh, I used the wrong bpo number for this change:

New changeset 740a84de73ad8d02655de0a084036f4b7e49a01b by Victor Stinner in branch 'master':
bpo-37191: Move TestPEP590 from test_capi to test_call (GH-13892)
https://github.com/python/cpython/commit/740a84de73ad8d02655de0a084036f4b7e49a01b

New changeset 5effd10bf14ab0a8a6695100aaf0b687eca68e6d by Miss Islington (bot) in branch '3.8':
bpo-37191: Move TestPEP590 from test_capi to test_call (GH-13892)
https://github.com/python/cpython/commit/5effd10bf14ab0a8a6695100aaf0b687eca68e6d
msg345852 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-06-17 12:27
New changeset 2ff58a24e8a1c7e290d025d69ebaea0bbead3b8c by Victor Stinner in branch 'master':
bpo-37194: Add a new public PyObject_CallNoArgs() function (GH-13890)
https://github.com/python/cpython/commit/2ff58a24e8a1c7e290d025d69ebaea0bbead3b8c
msg345854 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-06-17 12:58
New changeset 1ce2656f13e726b3b99d4c968926908cff1f460a by Victor Stinner in branch 'master':
bpo-37194: Complete PyObject_CallXXX() docs (GH-14156)
https://github.com/python/cpython/commit/1ce2656f13e726b3b99d4c968926908cff1f460a
msg345855 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-06-17 13:09
> bpo-37191: the new vector APIs declare "static inline" functions which are no C89 compatible and so cause compilation issues on pygobject3, python-dbus, xen (for example).

bpo-37191 have been fixed, so this issue can now be closed.
msg345857 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-06-17 13:23
New changeset ac4202ee4d53d6c0a07109e03795b70d91edbbb3 by Victor Stinner in branch '3.7':
bpo-37194: Complete PyObject_CallXXX() docs (GH-14156) (GH-14158)
https://github.com/python/cpython/commit/ac4202ee4d53d6c0a07109e03795b70d91edbbb3
msg345858 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-06-17 13:24
New changeset 71031cf4ed5ac9e330c8890b92379d9df383925b by Victor Stinner in branch '3.8':
bpo-37194: Complete PyObject_CallXXX() docs (GH-14156) (GH-14157)
https://github.com/python/cpython/commit/71031cf4ed5ac9e330c8890b92379d9df383925b
msg345862 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-06-17 15:15
New changeset 5352cc41fa4eb5f0dc847709392e88473b8593b0 by Victor Stinner in branch 'master':
bpo-37194: Add PyObject_CallNoArgs() rationale (GH-14159)
https://github.com/python/cpython/commit/5352cc41fa4eb5f0dc847709392e88473b8593b0
History
Date User Action Args
2020-01-07 20:28:53ncoghlansetpull_requests: - pull_request17306
2020-01-07 17:54:13petr.viktorinsetpull_requests: + pull_request17311
2020-01-07 16:05:38petr.viktorinsetpull_requests: + pull_request17306
2019-06-17 15:15:59vstinnersetmessages: + msg345862
2019-06-17 13:28:21vstinnersetpull_requests: + pull_request14001
2019-06-17 13:24:02vstinnersetmessages: + msg345858
2019-06-17 13:23:57vstinnersetmessages: + msg345857
2019-06-17 13:09:16vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg345855

stage: patch review -> resolved
2019-06-17 13:07:47vstinnersetpull_requests: + pull_request14000
2019-06-17 13:02:04vstinnersetpull_requests: + pull_request13999
2019-06-17 12:58:21vstinnersetmessages: + msg345854
2019-06-17 12:38:39vstinnersetpull_requests: + pull_request13998
2019-06-17 12:27:32vstinnersetmessages: + msg345852
2019-06-07 16:14:50vstinnersetmessages: + msg344960
2019-06-07 13:35:13vstinnersetfiles: + testcapi_call_no_args.patch

messages: + msg344936
2019-06-07 13:33:51vstinnersetfiles: + stack_overflow-4.py
2019-06-07 12:05:55vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request13764
2019-06-07 12:04:23jdemeyersetnosy: + jdemeyer
messages: + msg344929
2019-06-07 11:55:22vstinnersettitle: Move new vector headers to the internal C API -> Move new vector private declarations to the internal C API
2019-06-07 11:54:00vstinnercreate