| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Can find_loader and load_module be expressed in terms of find_spec?
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM, although I'm also curious as to whether or not the old methods could be redefined in terms of the new one.
Sorry, something went wrong.
Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
|
@serhiy-storchaka @ncoghlan the reason I didn't port the old methods over is I'm planning to deprecate them (and all other instances of find_module, find_loader, and load_module in the stdlib). I'm doing this first as I need it to land another PR which makes calling load_module raise an ImportWarning if __spec__.loader doesn't exist (#22905 was my attempt at that, but test_ensurepip of all things kept failing due to runpy importing the zip file). When I submit that PR I will deprecate these old methods in zipimport, and so porting seems unnecessary. It also makes porting to the new methods easier since you won't to contend with your code potentially breaking and having to move to a new API. |
Sorry, something went wrong.
Specifically, find_spec(), create_module(), and exec_module(). Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
| Back | FazBrowse Home | New Git URL |
https://bugs.python.org/issue42131