]> granicus.if.org Git - python/commitdiff
initxxsubtype(): Add a comment to make the magic clearer; I doubt it's
authorTim Peters <tim.peters@gmail.com>
Mon, 17 Dec 2001 18:26:19 +0000 (18:26 +0000)
committerTim Peters <tim.peters@gmail.com>
Mon, 17 Dec 2001 18:26:19 +0000 (18:26 +0000)
obvious to anyone except PyType_Ready's author <0.9 wink>.

Modules/xxsubtype.c

index d10840947a5dcf303fe46be2cb83e05e820d3bbf..f3d8e89ed74e10cf4bc965a786fe75b7826e8c62 100644 (file)
@@ -240,8 +240,10 @@ initxxsubtype(void)
 {
        PyObject *m, *d;
 
-       /* Fill in the deferred data addresses.  This must be done before
-          PyType_Ready() is called. */
+       /* Fill in deferred data addresses.  This must be done before
+          PyType_Ready() is called.  Note that PyType_Ready() automatically
+          initializes the ob.ob_type field to &PyType_Type if it's NULL,
+          so it's not necessary to fill in ob_type first. */
        spamdict_type.tp_base = &PyDict_Type;
        if (PyType_Ready(&spamdict_type) < 0)
                return;