gh-150082: Lazily import modules within standard library#150083
gh-150082: Lazily import modules within standard library#150083clin1234 wants to merge 6 commits into
Conversation
|
Ruff lint errors like: Can be fixed by updating it: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 6878a7d92e3..e378baf8930 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
- rev: e05c5c0818279e5ac248ac9e954431ba58865e61 # frozen: v0.15.7
+ rev: 5e2fb545eba1ea9dc051f6f962d52fe8f76a9794 # frozen: v0.15.13
hooks:
- id: ruff-check
name: Run Ruff (lint) on Platforms/Apple/ |
|
Or actually you'll need to update |
| import tempfile | ||
| from contextlib import nullcontext | ||
| from importlib import resources | ||
| lazy from importlib import resources |
There was a problem hiding this comment.
What's the point of lazily importing this? It's used on all of the public code paths through the module, and there don't seem to be any significant conditional branches which bypass the usage.
|
This PR is way too big: 237 changed files. Please split it up, and it's probably worth providing justification in the issue first, for why each particular import was chosen in each particular module. |
|
|
||
| # Now it is safe to import idlelib. | ||
| from idlelib.pyshell import main | ||
| lazy from idlelib.pyshell import main |
There was a problem hiding this comment.
Please don't make this change.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Uh oh!
There was an error while loading. Please reload this page.