Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4befff9

Browse files
committed
initxxsubtype(): Add a comment to make the magic clearer; I doubt it's
obvious to anyone except PyType_Ready's author <0.9 wink>.
1 parent a7b9b3c commit 4befff9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Modules/xxsubtype.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,10 @@ initxxsubtype(void)
240240
{
241241
PyObject *m, *d;
242242

243-
/* Fill in the deferred data addresses. This must be done before
244-
PyType_Ready() is called. */
243+
/* Fill in deferred data addresses. This must be done before
244+
PyType_Ready() is called. Note that PyType_Ready() automatically
245+
initializes the ob.ob_type field to &PyType_Type if it's NULL,
246+
so it's not necessary to fill in ob_type first. */
245247
spamdict_type.tp_base = &PyDict_Type;
246248
if (PyType_Ready(&spamdict_type) < 0)
247249
return;

0 commit comments

Comments
 (0)