| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Caution Review failedThe pull request is closed. WalkthroughAdds Frame.f_builtins getter exposing a frame's builtins dict and adds sys.stdlib_module_names attribute returning a frozen set of standard-library module names; also updates cspell dictionary with four new words. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
📜 Recent review details Configuration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro 📥 CommitsReviewing files that changed from the base of the PR and between e1362df and 2538f7b. ⛔ Files ignored due to path filters (1)
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 and usage tips. |
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)crates/vm/src/stdlib/sys.rs (1)📜 Review details446-452: Consider using .expect() instead of .unwrap() for better diagnostics.
The implementation correctly creates a frozen set of standard library module names. The .unwrap() call is safe in this context since all items are strings (which are hashable), but using .expect() with a descriptive message would provide better diagnostics if this ever fails unexpectedly.
🔎 Optional improvement#[pyattr(once)] fn stdlib_module_names(vm: &VirtualMachine) -> PyObjectRef { let names = STDLIB_MODULE_NAMES .iter() .map(|&n| vm.ctx.new_str(n).into()); - PyFrozenSet::from_iter(vm, names).unwrap().to_pyobject(vm) + PyFrozenSet::from_iter(vm, names) + .expect("stdlib_module_names should always be hashable") + .to_pyobject(vm) }
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📥 CommitsReviewing files that changed from the base of the PR and between 476b75d and e1362df.
⛔ Files ignored due to path filters (1)📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.rs: Follow the default rustfmt code style by running cargo fmt to format Rust code
Always run clippy to lint code (cargo clippy) before completing tasks and fix any warnings or lints introduced by changes
Follow Rust best practices for error handling and memory management
Use the macro system (pyclass, pymodule, pyfunction, etc.) when implementing Python functionality in Rust
Files:
Learnt from: CR Repo: RustPython/RustPython PR: 0 File: .github/copilot-instructions.md:0-0 Timestamp: 2025-12-27T14:03:49.011Z Learning: RustPython is a Python 3 interpreter written in Rust implementing Python 3.13.0+ compatibility with complete Python environment in Rust (not CPython bindings), clean implementation without compatibility hacks, and cross-platform support including WebAssembly compilation
Learnt from: moreal Repo: RustPython/RustPython PR: 5847 File: vm/src/stdlib/stat.rs:547-567 Timestamp: 2025-06-27T14:47:28.810Z Learning: In RustPython's stat module implementation, platform-specific constants like SF_SUPPORTED and SF_SYNTHETIC should be conditionally declared only for the platforms where they're available (e.g., macOS), following CPython's approach of optional declaration rather than providing fallback values for other platforms.
Learnt from: moreal Repo: RustPython/RustPython PR: 5847 File: vm/src/stdlib/stat.rs:547-567 Timestamp: 2025-06-27T14:47:28.810Z Learning: In RustPython's stat module implementation, platform-specific constants like SF_SUPPORTED and SF_SYNTHETIC should be conditionally declared only for the platforms where they're available (e.g., macOS), following CPython's approach of optional declaration using #ifdef checks rather than providing fallback values for other platforms.
Learnt from: moreal Repo: RustPython/RustPython PR: 5847 File: vm/src/stdlib/stat.rs:547-567 Timestamp: 2025-06-27T14:47:28.810Z Learning: In RustPython's stat module implementation, platform-specific constants like SF_SUPPORTED and SF_SYNTHETIC should be conditionally declared only for the platforms where they're available (e.g., macOS), following CPython's approach of optional declaration rather than providing fallback values for other platforms.
Applied to files:
Learnt from: moreal Repo: RustPython/RustPython PR: 5847 File: vm/src/stdlib/stat.rs:547-567 Timestamp: 2025-06-27T14:47:28.810Z Learning: In RustPython's stat module implementation, platform-specific constants like SF_SUPPORTED and SF_SYNTHETIC should be conditionally declared only for the platforms where they're available (e.g., macOS), following CPython's approach of optional declaration using #ifdef checks rather than providing fallback values for other platforms.
Applied to files:
[warning] 218-218:
Unknown word (pyrepl)
[warning] 215-215:
Unknown word (pydecimal)
[warning] 203-203:
Unknown word (multibytecodec)
[warning] 199-199:
Unknown word (lsprof)
crates/vm/src/builtins/frame.rs (1)crates/vm/src/stdlib/sys.rs (2)44-47: LGTM! Clean implementation of frame.f_builtins.
The getter correctly exposes the frame's builtins dictionary and follows the same pattern as f_globals. This aligns with Python's frame object interface.
12-13: LGTM! Necessary import for stdlib_module_names implementation.
Adding PyFrozenSet to the imports is required for the new stdlib_module_names attribute.
152-444: LGTM! Comprehensive standard library module list.
The constant list matches CPython's standard library modules. Note that the static analysis warnings about "unknown words" (pyrepl, pydecimal, multibytecodec, lsprof) are false positives—these are valid Python standard library module names.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
related to #6548
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.