Nick Coghlan <ncogh...@gmail.com> added the comment:

FWIW, I think it would be desirable to retain/restore some form of API that 
allows the creation of modules from files without requiring the user to know 
about module specs (or loaders, or anything else).

My current preference would be for a "module_from_file_location" counterpart to 
"spec_from_file_location" that implements Brett's recipe from above. That code 
is visually short, but conceptually very dense,and hence far from being obvious 
to most people trying to make the "path to module" leap.

Such a function could also cross-reference runpy.run_path for cases where don't 
want a module at all, just the top level namespace.

----------

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

Reply via email to