Skip to content
This repository was archived by the owner on Nov 17, 2020. It is now read-only.

Commit de27d56

Browse files
author
tim_one
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>. git-svn-id: http://svn.python.org/projects/python/trunk@24788 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 62992af commit de27d56

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)