mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
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".
This commit is contained in:
parent
7cf3d8e251
commit
bb86bf4c4e
21 changed files with 68 additions and 72 deletions
|
@ -2943,7 +2943,8 @@ static PyObject *
|
|||
array_arrayiterator___reduce___impl(arrayiterobject *self)
|
||||
/*[clinic end generated code: output=7898a52e8e66e016 input=a062ea1e9951417a]*/
|
||||
{
|
||||
PyObject *func = _PyObject_GetBuiltin("iter");
|
||||
_Py_IDENTIFIER(iter);
|
||||
PyObject *func = _PyEval_GetBuiltinId(&PyId_iter);
|
||||
if (self->ao == NULL) {
|
||||
return Py_BuildValue("N(())", func);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue