Skip to content

gh-152298: Fix LazyImportType.resolve reification#152308

Closed
Kuhai9801 wants to merge 1 commit into
python:mainfrom
Kuhai9801:gh-152298-lazy-resolve
Closed

gh-152298: Fix LazyImportType.resolve reification#152308
Kuhai9801 wants to merge 1 commit into
python:mainfrom
Kuhai9801:gh-152298-lazy-resolve

Conversation

@Kuhai9801

@Kuhai9801 Kuhai9801 commented Jun 26, 2026

Copy link
Copy Markdown

Make types.LazyImportType.resolve() cache successful reification and replace the original module global only when it still points at the same lazy proxy.

The tests cover cached resolves, stale/rebound/deleted globals, retry after failure, module attribute reification, copied proxies, and reentrant store handling.

Tests:

  • git diff --check
  • GitHub Actions required checks after squash

@python-cla-bot

python-cla-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@read-the-docs-community

read-the-docs-community Bot commented Jun 27, 2026

Copy link
Copy Markdown

@Kuhai9801 Kuhai9801 force-pushed the gh-152298-lazy-resolve branch 5 times, most recently from d1280b2 to c5ddf27 Compare June 28, 2026 07:35
@Kuhai9801

Copy link
Copy Markdown
Author

The remaining CI failures appear unrelated to this PR; they fail in Emscripten test_profiling and Windows Tk/IDLE tests, outside the lazy-import changes.

@pablogsal

Copy link
Copy Markdown
Member

I'm struggling really hard to review this or even understand this PR. Has this been ai generated?

@pablogsal

Copy link
Copy Markdown
Member

Ok I am closing this PR please review https://devguide.python.org/getting-started/ai-tools/

@pablogsal pablogsal closed this Jun 28, 2026
@Kuhai9801

Copy link
Copy Markdown
Author

Sorry about that, I accidentally mixed part of gh-152307 into this branch.

I’ll split it back out and keep this focused on gh-152298. Would you prefer a new smaller PR, or should I clean this one up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants