Message405919
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. |
|
Date |
User |
Action |
Args |
2021-11-08 00:51:22 | ncoghlan | set | recipients:
+ ncoghlan, brett.cannon, srittau, Arfrever, Claudiu.Popa, eric.snow, Borisd13, martin.panter, nikicat |
2021-11-08 00:51:22 | ncoghlan | set | messageid: <1636332682.29.0.166795258435.issue21436@roundup.psfhosted.org> |
2021-11-08 00:51:22 | ncoghlan | link | issue21436 messages |
2021-11-08 00:51:22 | ncoghlan | create | |
|