[issue18034] Last two entries in the programming FAQ are out of date (import related)
New submission from R. David Murray: The second to last talks about the __import__ quirk with out calling __import__ out as deprecated. The last uses the imp module for reload. ---------- assignee: docs@python components: Documentation messages: 189827 nosy: brett.cannon, docs@python, eric.snow, r.david.murray priority: normal severity: normal stage: needs patch status: open title: Last two entries in the programming FAQ are out of date (import related) type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18034> _______________________________________
Changes by Ezio Melotti <ezio.melotti@gmail.com>: ---------- nosy: +ezio.melotti _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18034> _______________________________________
Ezio Melotti added the comment: imp.reload() doesn't seem to be deprecated, and importlib.reload() doesn't exist. Is there another alternative or it just hasn't been moved somewhere else? ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18034> _______________________________________
Ezio Melotti added the comment: FTR here is a link to the FAQs: http://docs.python.org/3/faq/programming.html#import-x-y-z-returns-module-x-... ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18034> _______________________________________
Brett Cannon added the comment: Hasn't been moved yet. And the __import__ question should probably be rephrased as "don't do this". ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18034> _______________________________________
Changes by Brett Cannon <brett@python.org>: ---------- dependencies: +Document/deprecate imp _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18034> _______________________________________
Wouter van Heyst added the comment: The attached patch changes the body of the __import__ faq entry to suggest using `importlib.import_module` instead. ---------- keywords: +patch nosy: +larstiq Added file: http://bugs.python.org/file36227/faq-import_module.diff _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18034> _______________________________________
Roundup Robot added the comment: New changeset 815f1a69283e by Ezio Melotti in branch '3.4': #18034: update FAQ to suggest importlib.import_module instead of __import__. Patch by Wouter van Heyst. http://hg.python.org/cpython/rev/815f1a69283e New changeset f78ef3819d67 by Ezio Melotti in branch 'default': #18034: merge with 3.4. http://hg.python.org/cpython/rev/f78ef3819d67 New changeset 46c7a724b487 by Ezio Melotti in branch '2.7': #18034: update FAQ to suggest importlib.import_module instead of __import__. Patch by Wouter van Heyst. http://hg.python.org/cpython/rev/46c7a724b487 ---------- nosy: +python-dev _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18034> _______________________________________
Ezio Melotti added the comment: Fixed, thanks for the patch! The other FAQ got fixed in #17177/3d3b9d456eb8. ---------- assignee: docs@python -> ezio.melotti resolution: -> fixed stage: needs patch -> resolved status: open -> closed versions: +Python 2.7 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18034> _______________________________________
participants (5)
-
Brett Cannon
-
Ezio Melotti
-
R. David Murray
-
Roundup Robot
-
Wouter van Heyst