summaryrefslogtreecommitdiffstats
path: root/Include/ceval.h
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-12-11 06:28:18 (GMT)
committerGitHub <noreply@github.com>2018-12-11 06:28:18 (GMT)
commitbb86bf4c4eaa30b1f5192dab9f389ce0bb61114d (patch)
treeb9dbe54e2c1380294f3e2396450132d5b205af0a /Include/ceval.h
parent7cf3d8e25174c8871883e42f3240fd7f01efd3a8 (diff)
downloadcpython-bb86bf4c4eaa30b1f5192dab9f389ce0bb61114d.zip
cpython-bb86bf4c4eaa30b1f5192dab9f389ce0bb61114d.tar.gz
cpython-bb86bf4c4eaa30b1f5192dab9f389ce0bb61114d.tar.bz2
bpo-35444: Unify and optimize the helper for getting a builtin object. (GH-11047)
This speeds up pickling of some iterators. This fixes also error handling in pickling methods when fail to look up builtin "getattr".
Diffstat (limited to 'Include/ceval.h')
-rw-r--r--Include/ceval.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/Include/ceval.h b/Include/ceval.h
index bce8a0b..11283c0 100644
--- a/Include/ceval.h
+++ b/Include/ceval.h
@@ -48,10 +48,12 @@ PyAPI_FUNC(PyObject *) PyEval_GetGlobals(void);
PyAPI_FUNC(PyObject *) PyEval_GetLocals(void);
PyAPI_FUNC(struct _frame *) PyEval_GetFrame(void);
+#ifndef Py_LIMITED_API
+/* Helper to look up a builtin object */
+PyAPI_FUNC(PyObject *) _PyEval_GetBuiltinId(_Py_Identifier *);
/* Look at the current frame's (if any) code's co_flags, and turn on
the corresponding compiler flags in cf->cf_flags. Return 1 if any
flag was set, else return 0. */
-#ifndef Py_LIMITED_API
PyAPI_FUNC(int) PyEval_MergeCompilerFlags(PyCompilerFlags *cf);
#endif