File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1786,19 +1786,10 @@ These solutions are not mutually exclusive.
17861786__import__('x.y.z') returns <module 'x'>; how do I get z?
17871787---------------------------------------------------------
17881788
1789- Try::
1790-
1791- __import__('x.y.z').y.z
1792-
1793- For more realistic situations, you may have to do something like ::
1794-
1795- m = __import__(s)
1796- for i in s.split(".")[1:]:
1797- m = getattr(m, i)
1798-
1799- See :mod: `importlib ` for a convenience function called
1800- :func: `~importlib.import_module `.
1789+ Consider using the convenience function :func: `~importlib.import_module ` from
1790+ :mod: `importlib ` instead::
18011791
1792+ z = importlib.import_module('x.y.z')
18021793
18031794
18041795When I edit an imported module and reimport it, the changes don't show up. Why does this happen?
Original file line number Diff line number Diff line change @@ -549,6 +549,7 @@ Bernhard Herzog
549549Magnus L. Hetland
550550Raymond Hettinger
551551Kevan Heydon
552+ Wouter van Heyst
552553Kelsey Hightower
553554Jason Hildebrand
554555Richie Hindle
You can’t perform that action at this time.
0 commit comments