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 brett.cannon
Recipients Trundle, benjamin.peterson, brett.cannon, eric.araujo, eric.snow, ncoghlan, vstinner
Date 2012-02-22.15:23:05
SpamBayes Score 1.0943468e-12
Marked as misclassified No
Message-id <1329924186.32.0.9959628786.issue2377@psf.upfronthosting.co.za>
In-reply-to
Content
So refactoring the Python code into C code has been done, but it's crashing. =) As usual, manual memory management sucks.

I also think that their is still too much C code as it makes the whole thing somewhat brittle to any refactoring of importlib. I am seriously thinking of tossing the C code I have written and writing in C only the bare minimum needed to get to the sys.modules check, and otherwise punting to importlib for everything else in a single call or two. So that would mean performing the sanity check on the arguments, calculating the absolute name of the module, grabbing the import lock, checking sys.modules, failing that going to importlib, and then figuring out what to return regardless of where the module came from thanks to fromlist. So about four functions calls. Compare that to the 8 I'm making now along with the need to muck with other things and you can see why starting from scratch where I only care about the sys.modules fast path starts to look mighty attractive.
History
Date User Action Args
2012-02-22 15:23:06brett.cannonsetrecipients: + brett.cannon, ncoghlan, vstinner, benjamin.peterson, eric.araujo, Trundle, eric.snow
2012-02-22 15:23:06brett.cannonsetmessageid: <1329924186.32.0.9959628786.issue2377@psf.upfronthosting.co.za>
2012-02-22 15:23:05brett.cannonlinkissue2377 messages
2012-02-22 15:23:05brett.cannoncreate