removed get_package_path(), is_package() is back

This commit is contained in:
Just van Rossum 2002-12-30 22:39:07 +00:00
parent 7af5202bac
commit 59bf4255f7
1 changed files with 4 additions and 8 deletions

View File

@ -368,25 +368,21 @@ Optional Extensions to the Importer Protocol
additional methods which, to make it easier for the caller, each of
which should be implemented, or none at all.
loader.get_package_path(fullname)
loader.is_package(fullname)
loader.get_code(fullname)
loader.get_source(fullname)
All three methods should raise ImportError if the module wasn't
found.
The loader.get_package_path(fullname) method should return None if
the module specified by 'fullname' is not a package, or a list to
serve as pkg.__path__ if it is. It can be used to check
package-ness for a module ("loader.get_package_path(fullname) is not
None") but its main purpose is to tell our caller what pkg.__path__
would be if the module would actually be loaded.
The loader.is_package(fullname) method should return True if the
module specified by 'fullname' is a package and False if it isn't.
The loader.get_code(fullname) method should return the code object
associated with the module, or None if it's a built-in or extension
module. If the loader doesn't have the code object but it _does_
have the source code, it should return the compiled the source code.
(This is so that our caller doesn't also need to check get_source()
(This is so that our caller doesn't also need to check get_source()
if all it needs is the code object.)
The loader.get_source(fullname) method should return the source code