Antoine Pitrou <pit...@free.fr> added the comment: > > You can make the dictionary values as lists for the 'blocked' > > argument for import_fresh_module(). That would work [for io]. > > I don't understand how having multiple modules in the blocked list > will help in io case. io.py will simply not work if _io is blocked.
Which you avoid by giving an empty list of blocked modules, using Alexandre's suggestion. > I don't like that approach because it makes pure python code hard to > discover. Ok, but this code exists and it would be much better if it were supported. > The io/_pyio approach also prevents io.py from bring used by > alternative python implementations unmodified. It would be foolish to use it unmodified anyway, unless you like low-speed I/O (and a JIT isn't a magic bullet). The reason this was done like this is that the io module is imported at startup: we want to avoid unnecessary parsing of extraneous code (and unnecessary importing additional dependencies), and we also want to reduce opportunities for failing to initialize the standard I/O streams (especially stderr...). > This will not solve the io issue, but will add some flexibility. Which is pointless unless such flexibility is needed by someone. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue9104> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com