| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Expose _imp._set_lazy_attributes(modobj, name, /), used by CPython 3.15 importlib after eager loading. Match its empty pending-lazy-module registry behavior, including name type and string-subclass hashing checks. This does not implement lazy imports or change the target version or bundled libraries. Assisted-by: Codex:model-version-unavailable
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used 📚 Code guidelines (1)AGENTS.md — auto-discovered No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info ⚙️ Run configuration
Reviewing files that changed from the base of the PR and between ada43c4 and b6acc6a. 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 Walkthrough WalkthroughThe _imp module adds _set_lazy_attributes, which hashes the supplied name and returns None on success. Tests cover argument handling and hash behavior for Python 3.15. Changes_imp lazy attribute compatibility
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Suggested reviewers: youknowone Merge Risk: ⚪ Minimal · up to b6acc This adds a small compatibility hook so CPython 3.15 importlib code can call into RustPython. It does not change existing import behavior. No merge-blocking risk is evident. Security Architecture ReviewSecurity architecture risk: ⚪ Minimal · up to b6acc The new hook uses existing hashing behavior without itself changing module attributes or import state. The reviewed change introduces no material security risk or new authority boundary. Retained concerns Security Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
❌ Failed checks (1 warning)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. ❤️ ShareComment @coderabbitai help to get the list of available commands. |
Sorry, something went wrong.
There was a problem hiding this comment.
Is this also in CPython 3.15's Lib/test directory? If so, it will eventually be migrated over to RustPython when RustPython begins targeting CPython 3.15.
Sorry, something went wrong.
There was a problem hiding this comment.
yep, need to be checked
Sorry, something went wrong.
Move the distinct direct-hook argument and hashing contracts into the existing _imp snippet and remove the separate file. Preserve every pre-existing assertion and the CPython version guard; canonical 3.15 lazy-import tests already cover feature-level registry and reification behavior. Assisted-by: Codex:model-version-unavailable
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Add _imp._set_lazy_attributes(modobj, name, /), the private hook required by CPython 3.15 importlib after module loading.
In CPython v3.15.0rc2, this hook discards name from the pending lazy-module registry. RustPython currently executes imports eagerly and has no pending lazy entries. The implementation therefore validates the arguments and preserves string-subclass hashing (including exceptions), without modifying the module object.
This is a small native prerequisite for the target/site/importlib/test-support migration. It does not implement PEP 810 lazy imports. When a real lazy-module registry is introduced, this hook must remove the corresponding pending entry.
Only _imp.rs and one regression snippet change. The target version, bundled libraries, compiler, sentinel builtin, and cached import callback remain unchanged. The callback adjustment stays with the importlib migration, whose hierarchical-lock changes are needed for the concurrent-import cases.
Validation
Hook-only branch at 29d5ba99196b4a41c48946ee90ab762d5affa739:
The identical hook code also passed full Rust validation in the broader native-import candidate e2f1ed22366d258f4352e5ffaccebefa0bbfe467: workspace 1,345 passed/18 ignored, separate C-API 115 passed/4 ignored, and both all-targets Clippy commands clean. Those full Rust aggregates were not rerun after dropping the separate cached-importer change; the smaller branch was independently rebuilt and runtime-tested as above. No full Python 3.15 compatibility claim is made.
The snippet follows the existing skip_if_unsupported convention: every assertion always runs on RustPython; only the CPython comparison below 3.15 skips this unavailable API. It also runs separately against exact CPython 3.15.0rc2, commit 435c9e5a798c99653e3ab64ce29baed0e4f3dfee.
AI assistance
OpenAI Codex assisted with implementation, CPython comparison, tests, review, and this description under maintainer direction. The runtime did not expose the exact model version. Reported checks are automated Linux x86_64 verification; no additional human-use or untested-platform validation is claimed.
Summary by CodeRabbit