aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Include/cpython/abstract.h
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.com>2024-02-12 07:53:52 +0300
committerDaniil Cherednik <dcherednik@ydb.tech>2024-02-14 14:26:16 +0000
commit31f2a419764a8ba77c2a970cfc80056c6cd06756 (patch)
treec1995d239eba8571cefc640f6648e1d5dd4ce9e2 /contrib/tools/python3/src/Include/cpython/abstract.h
parentfe2ef02b38d9c85d80060963b265a1df9f38c3bb (diff)
downloadydb-31f2a419764a8ba77c2a970cfc80056c6cd06756.tar.gz
Update Python from 3.11.8 to 3.12.2
Diffstat (limited to 'contrib/tools/python3/src/Include/cpython/abstract.h')
-rw-r--r--contrib/tools/python3/src/Include/cpython/abstract.h25
1 files changed, 6 insertions, 19 deletions
diff --git a/contrib/tools/python3/src/Include/cpython/abstract.h b/contrib/tools/python3/src/Include/cpython/abstract.h
index d276669312..3b27aab2fc 100644
--- a/contrib/tools/python3/src/Include/cpython/abstract.h
+++ b/contrib/tools/python3/src/Include/cpython/abstract.h
@@ -50,23 +50,18 @@ PyAPI_FUNC(PyObject *) _PyObject_MakeTpCall(
PyObject *const *args, Py_ssize_t nargs,
PyObject *keywords);
-#define PY_VECTORCALL_ARGUMENTS_OFFSET \
- (_Py_STATIC_CAST(size_t, 1) << (8 * sizeof(size_t) - 1))
-
+// PyVectorcall_NARGS() is exported as a function for the stable ABI.
+// Here (when we are not using the stable ABI), the name is overridden to
+// call a static inline function for best performance.
+#define PyVectorcall_NARGS(n) _PyVectorcall_NARGS(n)
static inline Py_ssize_t
-PyVectorcall_NARGS(size_t n)
+_PyVectorcall_NARGS(size_t n)
{
return n & ~PY_VECTORCALL_ARGUMENTS_OFFSET;
}
PyAPI_FUNC(vectorcallfunc) PyVectorcall_Function(PyObject *callable);
-PyAPI_FUNC(PyObject *) PyObject_Vectorcall(
- PyObject *callable,
- PyObject *const *args,
- size_t nargsf,
- PyObject *kwnames);
-
// Backwards compatibility aliases for API that was provisional in Python 3.8
#define _PyObject_Vectorcall PyObject_Vectorcall
#define _PyObject_VectorcallMethod PyObject_VectorcallMethod
@@ -84,10 +79,6 @@ PyAPI_FUNC(PyObject *) PyObject_VectorcallDict(
size_t nargsf,
PyObject *kwargs);
-/* Call "callable" (which must support vectorcall) with positional arguments
- "tuple" and keyword arguments "dict". "dict" may also be NULL */
-PyAPI_FUNC(PyObject *) PyVectorcall_Call(PyObject *callable, PyObject *tuple, PyObject *dict);
-
// Same as PyObject_Vectorcall(), except without keyword arguments
PyAPI_FUNC(PyObject *) _PyObject_FastCall(
PyObject *func,
@@ -96,10 +87,6 @@ PyAPI_FUNC(PyObject *) _PyObject_FastCall(
PyAPI_FUNC(PyObject *) PyObject_CallOneArg(PyObject *func, PyObject *arg);
-PyAPI_FUNC(PyObject *) PyObject_VectorcallMethod(
- PyObject *name, PyObject *const *args,
- size_t nargsf, PyObject *kwnames);
-
static inline PyObject *
PyObject_CallMethodNoArgs(PyObject *self, PyObject *name)
{
@@ -176,7 +163,7 @@ PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t);
/* Assume tp_as_sequence and sq_item exist and that 'i' does not
need to be corrected for a negative index. */
#define PySequence_ITEM(o, i)\
- ( Py_TYPE(o)->tp_as_sequence->sq_item(o, i) )
+ ( Py_TYPE(o)->tp_as_sequence->sq_item((o), (i)) )
#define PY_ITERSEARCH_COUNT 1
#define PY_ITERSEARCH_INDEX 2