Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
56b4ca78
Commit
56b4ca78
authored
Nov 17, 2012
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #16489: Make it clearer that importlib.find_loader() requires
the user to import any parent packages.
parent
4a42ec50
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
Doc/library/importlib.rst
Doc/library/importlib.rst
+4
-5
Lib/importlib/__init__.py
Lib/importlib/__init__.py
+3
-1
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Doc/library/importlib.rst
View file @
56b4ca78
...
...
@@ -94,11 +94,10 @@ Functions
:
exc
:`
ValueError
`
is
raised
).
Otherwise
a
search
using
:
attr
:`
sys
.
meta_path
`
is
done
.
``
None
``
is
returned
if
no
loader
is
found
.
A
dotted
name
does
not
have
its
parent
's implicitly imported. If that is
desired (although not nessarily required to find the loader, it will most
likely be needed if the loader actually is used to load the module), then
you will have to import the packages containing the module prior to calling
this function.
A
dotted
name
does
not
have
its
parent
's implicitly imported as that requires
loading them and that may not be desired. To properly import a submodule you
will need to import all parent packages of the submodule and use the correct
argument to *path*.
.. function:: invalidate_caches()
...
...
Lib/importlib/__init__.py
View file @
56b4ca78
...
...
@@ -55,7 +55,9 @@ def find_loader(name, path=None):
value of 'path' given to the finders. None is returned if no loader could
be found.
Dotted names do not have their parent packages implicitly imported.
Dotted names do not have their parent packages implicitly imported. You will
most likely need to explicitly import all parent packages in the proper
order for a submodule to get the correct loader.
"""
try
:
...
...
Misc/NEWS
View file @
56b4ca78
...
...
@@ -271,6 +271,9 @@ Tools/Demos
Documentation
-------------
-
Issue
#
16489
:
Make
it
clearer
that
importlib
.
find_loader
()
requires
any
and
all
packages
to
be
separately
imported
.
-
Issue
#
16400
:
Update
the
description
of
which
versions
of
a
given
package
PyPI
displays
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment