mirror of
https://github.com/python/cpython.git
synced 2025-07-27 21:24:32 +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
|
@ -6605,9 +6605,9 @@ PyInit__testcapi(void)
|
|||
if (m == NULL)
|
||||
return NULL;
|
||||
|
||||
Py_TYPE(&_HashInheritanceTester_Type)=&PyType_Type;
|
||||
Py_SET_TYPE(&_HashInheritanceTester_Type, &PyType_Type);
|
||||
|
||||
Py_TYPE(&test_structmembersType)=&PyType_Type;
|
||||
Py_SET_TYPE(&test_structmembersType, &PyType_Type);
|
||||
Py_INCREF(&test_structmembersType);
|
||||
/* don't use a name starting with "test", since we don't want
|
||||
test_capi to automatically call this */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue