FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-42131: Add PEP 451-related methods to zipimport by brettcannon · Pull Request #23187 · python/cpython · GitHub

Repository navigation

bpo-42131: Add PEP 451-related methods to zipimport - #23187

Merged
brettcannon merged 6 commits into
python:masterfrom
brettcannon:zipimport-spec
Nov 13, 2020
Merged

brettcannon merged 6 commits into
python:masterfrom
brettcannon:zipimport-spec

Conversation

brettcannon commented Nov 7, 2020 •
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Can find_loader and load_module be expressed in terms of find_spec?

ncoghlan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM, although I'm also curious as to whether or not the old methods could be redefined in terms of the new one.

Comment thread Doc/library/zipimport.rst
Comment thread Doc/library/zipimport.rst Outdated
Comment thread Lib/test/test_zipimport.py Outdated
Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>

Copy link
Copy Markdown
Member Author

@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.

brettcannon merged commit d2e94bb into python:master Nov 13, 2020
brettcannon deleted the zipimport-spec branch November 13, 2020 23:14
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
Specifically, find_spec(), create_module(), and exec_module().

Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL