[Python-Dev] refcounting vs PyModule_AddObject
Skip Montanaro
skip at pobox.com
Wed Jun 15 14:57:00 CEST 2005
Michael> So I went looking for other instances of the same problem. I
Michael> didn't find any (though I don't understand how _csv.c gets away
Michael> with line 1579)...
Same reason the Py_INCREF of ProfileError isn't necessary I think.
PyDict_New() returns a new reference which is passed onto
PyModule_AddObject(). No Py_DECREF of the dialects dict occurs, so it exits
reference-neutral w.r.t. the dialects object.
Skip
More information about the Python-Dev
mailing list