@@ -19,43 +19,6 @@ PyAPI_FUNC(Py_ssize_t) _PyInterpreterState_GetRefTotal(PyInterpreterState *);
1919#endif
2020
2121
22- /********************* String Literals ****************************************/
23- /* This structure helps managing static strings. The basic usage goes like this:
24- Instead of doing
25-
26- r = PyObject_CallMethod(o, "foo", "args", ...);
27-
28- do
29-
30- _Py_IDENTIFIER(foo);
31- ...
32- r = _PyObject_CallMethodId(o, &PyId_foo, "args", ...);
33-
34- PyId_foo is a static variable, either on block level or file level. On first
35- usage, the string "foo" is interned, and the structures are linked. On interpreter
36- shutdown, all strings are released.
37-
38- Alternatively, _Py_static_string allows choosing the variable name.
39- _PyUnicode_FromId returns a borrowed reference to the interned string.
40- _PyObject_{Get,Set,Has}AttrId are __getattr__ versions using _Py_Identifier*.
41- */
42- typedef struct _Py_Identifier {
43- const char * string ;
44- // Index in PyInterpreterState.unicode.ids.array. It is process-wide
45- // unique and must be initialized to -1.
46- Py_ssize_t index ;
47- } _Py_Identifier ;
48-
49- #ifndef Py_BUILD_CORE
50- // For now we are keeping _Py_IDENTIFIER for continued use
51- // in non-builtin extensions (and naughty PyPI modules).
52-
53- #define _Py_static_string_init (value ) { .string = (value), .index = -1 }
54- #define _Py_static_string (varname , value ) static _Py_Identifier varname = _Py_static_string_init(value)
55- #define _Py_IDENTIFIER (varname ) _Py_static_string(PyId_##varname, #varname)
56-
57- #endif /* !Py_BUILD_CORE */
58-
5922typedef struct {
6023 /* Number implementations must check *both*
6124 arguments for proper type and implement the necessary conversions
@@ -273,18 +236,13 @@ typedef struct _heaptypeobject {
273236
274237PyAPI_FUNC (const char * ) _PyType_Name (PyTypeObject * );
275238PyAPI_FUNC (PyObject * ) _PyType_Lookup (PyTypeObject * , PyObject * );
276- PyAPI_FUNC (PyObject * ) _PyType_LookupId (PyTypeObject * , _Py_Identifier * );
277- PyAPI_FUNC (PyObject * ) _PyObject_LookupSpecialId (PyObject * , _Py_Identifier * );
278239PyAPI_FUNC (PyObject * ) PyType_GetModuleByDef (PyTypeObject * , PyModuleDef * );
279240PyAPI_FUNC (PyObject * ) PyType_GetDict (PyTypeObject * );
280241
281242PyAPI_FUNC (int ) PyObject_Print (PyObject * , FILE * , int );
282243PyAPI_FUNC (void ) _Py_BreakPoint (void );
283244PyAPI_FUNC (void ) _PyObject_Dump (PyObject * );
284245
285- PyAPI_FUNC (PyObject * ) _PyObject_GetAttrId (PyObject * , _Py_Identifier * );
286- PyAPI_FUNC (int ) _PyObject_SetAttrId (PyObject * , _Py_Identifier * , PyObject * );
287-
288246PyAPI_FUNC (PyObject * * ) _PyObject_GetDictPtr (PyObject * );
289247PyAPI_FUNC (void ) PyObject_CallFinalizer (PyObject * );
290248PyAPI_FUNC (int ) PyObject_CallFinalizerFromDealloc (PyObject * );
0 commit comments