Message168234
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. |
|
Date |
User |
Action |
Args |
2012-08-14 19:43:58 | Robin.Schreiber | set | recipients:
+ Robin.Schreiber, loewis, gstein, gregory.p.smith, pitrou |
2012-08-14 19:43:58 | Robin.Schreiber | set | messageid: <1344973438.7.0.0832940303654.issue15653@psf.upfronthosting.co.za> |
2012-08-14 19:43:58 | Robin.Schreiber | link | issue15653 messages |
2012-08-14 19:43:57 | Robin.Schreiber | create | |
|