Brett Cannon <br...@python.org> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue2377>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to