NOTES 2.12 KB
Newer Older
1 2 3
to do
/////

4 5 6 7
* Refactor source/bytecode finder/loader code such that bytecode support is a
  subclass of source support (makes it nicer for VMs that don't use CPython
  bytecode).

8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
    + ExtensionFileFinder
    + PyFileFinder
    + PyPycFileFinder
    + PyFileLoader

        - get_code for source only
        - get_data
        - source_mtime
        - source_path

    + PyPycFileLoader(PyFileLoader)

        - get_code
        - bytecode_path
        - write_bytecode

Brett Cannon's avatar
Brett Cannon committed
24 25 26 27
* Implement PEP 302 protocol for loaders (should just be a matter of testing).

    + Source/bytecode.

28
* Public API left to expose (w/ docs!)
29

30 31 32
    + abc

        - Finder
33

34
            * find_module
35

36
        - Loader
37

38
            * load_module
39

40 41
        - (?) Importer(Finder, Loader)
        - ResourceLoader(Loader)
42

43
            * get_data
44

45
        - InspectLoader(Loader)
46

47 48 49
            * is_package
            * get_code
            * get_source
50

51
        - (?) SourceLoader(ResourceLoader)
52

53 54 55
            * source_path
            * bytecode_path
            * write_bytecode (not abstract)
56

57
    + util
58

59
        - set___package__ decorator
60

61
    + machinery
62

63
        - Extensions importers
64

65 66
            * ExtensionFinder
            * (?) Loader
67

68
        - Source/bytecode importers
69

70 71
            * SourceFinder
            * (?) Loader
72

73
    + test (Really want to worry about compatibility with future versions?)
74

75
        - abc
76

77 78
            * FinderTests [doc]
            * LoaderTests [doc]
79

80 81 82 83 84 85 86
* Remove ``import *`` from importlib.__init__.

* Remove __all__ from importlib._bootstrap.

* Add leading underscores to all objects in importlib._bootstrap that are not
  publicly exposed.

87 88 89 90 91
* Make sure that there is documentation *somewhere* fully explaining the
semantics of import that can be referenced from the package's documentation
(even if it is in the package documentation itself, although it might be best
in the language specification).

Brett Cannon's avatar
Brett Cannon committed
92 93 94 95
* Write benchmark suite.

* OPTIMIZE!

96 97
  + Fast path absolute name.
  + Fast path pulling from sys.modules.
Brett Cannon's avatar
Brett Cannon committed
98

99
* Bootstrap importlib as implementation of builtins.__import__
100 101 102 103 104 105

* Replace standard library modules.

  + imp
  + py_compile
  + compileall