GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||
GeezerVison is showing github.com — gh-118761: Add test_lazy_import for more modules by danielhollas · Pull Request #133057 · python/cpython Conversation
|
|
@Wulian233 I am not sure what you mean. Please see #132614 and #118761 (comment) for the motivation. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks! Feel free to make the same change for more modules in this PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@JelleZijlstra thanks for taking a look! I've added the tests for Unless somebody else beats me to it, I can go through the rest of the modules handled in #118761, maybe next weekend. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
… string and zipfile modules
I went through the rest of the modules from #118761 and added the respective tests. This should be good to go. @JelleZijlstra I pushed one more commit which I forgot to push with the others, apologies. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Found a few more
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Also a merge conflict. If you don't get to it I can spend a bit more time later today fixing it up, hopefully we can still get it in by the beta. (And it's not the end of the world if we don't.) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-authored-by: Jelle Zijlstra <[email protected]>
Done, thanks for a thorough review!
Ah, good thinking. I've only included those modules that were specifically made lazy in the various PRs. This got me thinking though that the current approach is somewhat suboptimal -- it would be more robust to have an allowlist of modules. Right now, a previously unused module can still be added and the tests might still pass. But this PR is definitely an improvement, LMK if you want me to open a follow-up issue for discussion. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
An allowlist could make sense too, but might be harder to maintain. Feel free to open an issue discussing it. I guess my primary motivation was "I did all this work to make it so typing doesn't import annotationlib, let's make it so we don't regress by accident". |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-authored-by: Jelle Zijlstra <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.