PyDocs

Nav

Importing Modules

SourceLoader

Abstract base class for loading source code (and optionally any
corresponding bytecode).

To support loading from source code, the abstractmethods inherited from
ResourceLoader and ExecutionLoader need to be implemented. To also support
loading from bytecode, the optional methods specified directly by this ABC
is required.

Inherited abstractmethods not implemented in this ABC:

    * ResourceLoader.get_data
    * ExecutionLoader.get_filename
Changed in 3.15
  • 3.15: Removed the load_module() method.
Members of SourceLoader

e

exec_module
Execute the module.

g

get_code
Concrete implementation of InspectLoader.get_code.
get_source
Concrete implementation of InspectLoader.get_source.

i

is_package
Concrete implementation of InspectLoader.is_package by checking if the path returned by get_filename has a filename of '__init__.py'.

p

path_mtime
Return the (int) modification time for the path (str).
path_stats
Return a metadata dict for the source pointed to by the path (str).

s

set_data
Write the bytes to the path (if possible).
0 Examples
No examples for importlib.abc/SourceLoader.
See Also
No see-alsos for importlib.abc/SourceLoader
0 Notes
No notes for SourceLoader