Skip to content

Conversation

@youknowone
Copy link
Member

@youknowone youknowone commented Feb 1, 2026

Summary by CodeRabbit

  • New Features

    • Added bz2 and compression modules to the standard library, expanding data compression capabilities.
  • Chores

    • Refactored internal module organization for improved code structure and maintainability. Updated visibility policies to align with architectural best practices.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 1, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Adds internal bz2 and compression modules to stdlib, removes gc from that stdlib declaration, registers a private gc module in crates/vm/src/stdlib, and narrows PyObject::gc_finalized visibility to crate-only; also updates import paths in the gc stdlib file.

Changes

Cohort / File(s) Summary
Stdlib core modules
crates/stdlib/src/lib.rs
Adds mod bz2; and mod compression; (compression marked internal); removes previous gc declaration from this file and adds bz2::module_def(ctx) and compression::module_def(ctx) to stdlib_module_defs.
VM stdlib registration
crates/vm/src/stdlib/mod.rs
Adds private mod gc; and registers gc::module_def(ctx) in builtin_module_defs.
GC implementation changes
crates/vm/src/stdlib/gc.rs
Updates imports to use direct crate-root types (PyObjectRef, PyResult, VirtualMachine, builtins::PyListRef, function::{FuncArgs, OptionalArg}) and removes a comment in is_finalized (function now directly returns obj.gc_finalized()).
API visibility
crates/vm/src/object/core.rs
Changes PyObject::gc_finalized visibility from pub fn to pub(crate) fn, restricting access to the crate.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • ShaharNaveh

Poem

🐰 I hopped through modules, tidy and spry,

Added bz2, compression — gave gc a new sky.
A quieter finale, visibility small,
The rabbit applauds changes, big and small. 🥕✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2026

Code has been automatically formatted

The code in this PR has been formatted using:

  • cargo fmt --all
    Please pull the latest changes before pushing again:
git pull origin gc-location

@youknowone youknowone marked this pull request as ready for review February 1, 2026 04:21
@youknowone youknowone merged commit 5e4c3b0 into RustPython:main Feb 1, 2026
12 of 13 checks passed
@youknowone youknowone deleted the gc-location branch February 1, 2026 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant