[issue9254] __import__ docstring should recommend importlib.import_module()

Éric Araujo report at bugs.python.org
Wed Jul 14 01:24:17 CEST 2010


Éric Araujo <merwok at netwok.org> added the comment:

More rationale for not using a dummy fromlist, from Brett Cannon:

“Pulling from sys.modules is the correct way to do this. There are subtle
issues when using a bunk fromlist argument (empty modules, double
initialization, etc.). If one does not use importlib.import_module --
written *specifically* to prevent people from doing the nasty hack with the fromlist -- then you should use the sys.modules approach, period”

----------
nosy: +merwok

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9254>
_______________________________________


More information about the Python-bugs-list mailing list