diff --git a/pep-0302.txt b/pep-0302.txt index ffcf68204..b387c80a6 100644 --- a/pep-0302.txt +++ b/pep-0302.txt @@ -223,9 +223,13 @@ Specification part 1: The Importer Protocol loader.load_module(fullname) - This method returns the loaded module. In many cases the importer - and loader can be one and the same object: importer.find_module() - would just return self. + This method returns the loaded module or raises and exception, + preferably ImportError if an existing exception is not being + propagated. If load_module() is asked to laod a module that it + cannot, ImportError is to be raised. + + In many cases the importer and loader can be one and the same + object: importer.find_module() would just return self. The 'fullname' argument of both methods is the fully qualified module name, for example "spam.eggs.ham". As explained above, when @@ -267,6 +271,9 @@ Specification part 1: The Importer Protocol not having a __file__ attribute at all is reserved for built-in modules. + - The __name__ attribute must be set. If one uses + imp.new_module() then the attribute is set automatically. + - If it's a package, the __path__ variable must be set. This must be a list, but may be empty if __path__ has no further significance to the importer (more on this later).