From 0b1de84b48492cf9cfbd24cd0b856acb81b8e7f7 Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Mon, 17 Dec 2001 18:26:19 +0000 Subject: initxxsubtype(): Add a comment to make the magic clearer; I doubt it's obvious to anyone except PyType_Ready's author <0.9 wink>. --- Modules/xxsubtype.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Modules/xxsubtype.c') diff --git a/Modules/xxsubtype.c b/Modules/xxsubtype.c index d10840947a..f3d8e89ed7 100644 --- a/Modules/xxsubtype.c +++ b/Modules/xxsubtype.c @@ -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; -- cgit v1.2.1