This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Robin.Schreiber
Recipients Robin.Schreiber, gregory.p.smith, gstein, loewis, pitrou
Date 2012-08-14.19:43:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1344973438.7.0.0832940303654.issue15653@psf.upfronthosting.co.za>
In-reply-to
Content
Regarding the macro definition, I would be fine with changing it to _hashlib_state.

The dance you have found inside the Init, makes shure that the very same module is returned if Init is called twice or multiple times, before the Module is unloaded. A month back, when I created this patch, I had statements such as test.import.import_fresh_module(...) call the Init-method multiple times, before a module was unloaded. This was apparently a bug, as I can no longer reproduce this behavior, but at that time I thought it was the expected behavior :-)

The last code snipped verifies, that we only dereference the type if the dealloc function is not being called from inside the subtype_dealloc function. This is necessary because the subtype_dealloc function itself contains a decref of the respective type object. Without this check, we would then end up decrefing the type too many times.
History
Date User Action Args
2012-08-14 19:43:58Robin.Schreibersetrecipients: + Robin.Schreiber, loewis, gstein, gregory.p.smith, pitrou
2012-08-14 19:43:58Robin.Schreibersetmessageid: <1344973438.7.0.0832940303654.issue15653@psf.upfronthosting.co.za>
2012-08-14 19:43:58Robin.Schreiberlinkissue15653 messages
2012-08-14 19:43:57Robin.Schreibercreate