5.9. Open issues 61 The Python Language Reference, Release 3.9.5 5.9 Open issues 5.10 References PEP 451 adds the encapsulation of per-module import state in spec objects. It also off-loads most of the boilerplate responsibilities of loaders back onto the import machinery. These changes allow the deprecation of several APIs in the import system and also addition of new methods to finders and loaders. PEP 338 defines executing modules as scripts. PEP 328 introduced absolute and explicit relative imports and initially proposed$_{__name__}$ for semantics PEP 366 would eventually specify for$_{__package__}$ . PEP 366 describes the addition of the$_{__package__}$ attribute for explicit relative imports in main modules. PEP 420 introduced namespace packages for Python 3.3. PEP 420 also introduced the find_loader() protocol as an alternative to$_{find_module()}$ . The original specification for sys.meta_path was PEP 302 , with subsequent extension in PEP 420 . The import machinery has evolved considerably since Python’s early days. The original specification for packages is still available to read, although some details have changed since the writing of that document. XXX Add more info on$_{__main__}$ quirks/pitfalls (i.e. copy from PEP 395 ). XXX Add more explanation regarding the different ways in which __main__ is initialized? XXX runpy, pkgutil, et al in the library manual should all get “See Also” links at the top pointing to the new import system section. XXX * (import_machinery.rst) how about a section devoted just to the attributes of modules and packages, perhaps expanding upon or supplanting the related entries in the data model reference page? XXX It would be really nice to have a diagram.