22
33#include "opcode.h"
44
5+ #include "pycore_bytesobject.h" // _PyBytes_Concat
56#include "pycore_code.h"
67#include "pycore_critical_section.h"
78#include "pycore_descrobject.h" // _PyMethodWrapper_Type
@@ -2166,24 +2167,6 @@ int_tuple_multiply(PyObject *lhs, PyObject *rhs)
21662167 return seq_int_multiply (rhs , lhs , PyTuple_Type .tp_as_sequence -> sq_repeat );
21672168}
21682169
2169- static PyObject *
2170- bytes_bytes_add (PyObject * lhs , PyObject * rhs )
2171- {
2172- return PyBytes_Type .tp_as_sequence -> sq_concat (lhs , rhs );
2173- }
2174-
2175- static PyObject *
2176- dict_dict_or (PyObject * lhs , PyObject * rhs )
2177- {
2178- return PyDict_Type .tp_as_number -> nb_or (lhs , rhs );
2179- }
2180-
2181- static PyObject *
2182- dict_dict_ior (PyObject * lhs , PyObject * rhs )
2183- {
2184- return PyDict_Type .tp_as_number -> nb_inplace_or (lhs , rhs );
2185- }
2186-
21872170static int
21882171compactlongs_guard (PyObject * lhs , PyObject * rhs )
21892172{
@@ -2311,8 +2294,8 @@ static _PyBinaryOpSpecializationDescr binaryop_extend_descrs[] = {
23112294
23122295 /* bytes + bytes: bytes_concat may return an operand when one side
23132296 is empty, so result is not always unique. */
2314- {NB_ADD , NULL , bytes_bytes_add , & PyBytes_Type , 0 , & PyBytes_Type , & PyBytes_Type },
2315- {NB_INPLACE_ADD , NULL , bytes_bytes_add , & PyBytes_Type , 0 , & PyBytes_Type , & PyBytes_Type },
2297+ {NB_ADD , NULL , _PyBytes_Concat , & PyBytes_Type , 0 , & PyBytes_Type , & PyBytes_Type },
2298+ {NB_INPLACE_ADD , NULL , _PyBytes_Concat , & PyBytes_Type , 0 , & PyBytes_Type , & PyBytes_Type },
23162299
23172300 /* bytes * int / int * bytes: call bytes_repeat directly.
23182301 bytes_repeat returns the original when n == 1. */
@@ -2329,8 +2312,8 @@ static _PyBinaryOpSpecializationDescr binaryop_extend_descrs[] = {
23292312 {NB_INPLACE_MULTIPLY , NULL , int_tuple_multiply , & PyTuple_Type , 0 , & PyLong_Type , & PyTuple_Type },
23302313
23312314 /* dict | dict */
2332- {NB_OR , NULL , dict_dict_or , & PyDict_Type , 1 , & PyDict_Type , & PyDict_Type },
2333- {NB_INPLACE_OR , NULL , dict_dict_ior , & PyDict_Type , 0 , & PyDict_Type , & PyDict_Type },
2315+ {NB_OR , NULL , _PyDict_Or , & PyDict_Type , 1 , & PyDict_Type , & PyDict_Type },
2316+ {NB_INPLACE_OR , NULL , _PyDict_IOr , & PyDict_Type , 0 , & PyDict_Type , & PyDict_Type },
23342317};
23352318
23362319static int
0 commit comments