New submission from Brett Cannon: There are a bunch of attributes that need to be set on a module, and yet they are only handled by various decorators in importlib.util. The problem with that is there is no way in the API to override or expand upon setting those attributes pre-loading; only post-loading like what set_loader and set_package do.
importlib.abc.Loader.init_module_attrs(module) would take a module and then using whatever methods are available, sets as many attributes as possible. This method can either be called before execution of the module's code or after some function is called that directly returns a loaded module (e.g. BuiltinImporter). ---------- assignee: brett.cannon components: Library (Lib) messages: 190260 nosy: brett.cannon priority: normal severity: normal stage: test needed status: open title: Create importlib.abc.Loader.init_module_attrs() type: enhancement versions: Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18088> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com