mirror of
https://github.com/python/cpython.git
synced 2025-07-10 04:45:36 +00:00
bpo-39573: Add Py_SET_TYPE() function (GH-18394)
Add Py_SET_TYPE() function to set the type of an object.
This commit is contained in:
parent
daa9756cb6
commit
d2ec81a8c9
24 changed files with 77 additions and 48 deletions
|
@ -2835,11 +2835,11 @@ PyInit__testbuffer(void)
|
|||
if (m == NULL)
|
||||
return NULL;
|
||||
|
||||
Py_TYPE(&NDArray_Type) = &PyType_Type;
|
||||
Py_SET_TYPE(&NDArray_Type, &PyType_Type);
|
||||
Py_INCREF(&NDArray_Type);
|
||||
PyModule_AddObject(m, "ndarray", (PyObject *)&NDArray_Type);
|
||||
|
||||
Py_TYPE(&StaticArray_Type) = &PyType_Type;
|
||||
Py_SET_TYPE(&StaticArray_Type, &PyType_Type);
|
||||
Py_INCREF(&StaticArray_Type);
|
||||
PyModule_AddObject(m, "staticarray", (PyObject *)&StaticArray_Type);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue