Brett Cannon added the comment:

Here is an implementation of importlib.util.module_from_spec(). With this it 
makes PEP 451 conceptually work like:

  spec = importlib.util.find_spec(name)
  module = importlib.util.module_from_spec(spec)
  spec.loader.exec_module(module)

About the only other thing I can think of that people might still want is 
something like `importlib.util.load(spec)` so that they don't even need to care 
about whether load_module() or exec_module() is defined, but that can be a 
separate issue if it turns out people actually want something like that.

----------
keywords: +patch
stage: test needed -> commit review
Added file: http://bugs.python.org/file35286/module_from_spec.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20383>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to