Skip to content

remove less useful Context::ellipsis() #5973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2025

Conversation

youknowone
Copy link
Member

@youknowone youknowone commented Jul 14, 2025

Summary by CodeRabbit

  • Refactor
    • Updated internal handling of the Ellipsis constant to improve object ownership and consistency.
    • Removed a redundant method related to Ellipsis object retrieval.

No visible changes to end-user features or behavior.

Copy link
Contributor

coderabbitai bot commented Jul 14, 2025

Walkthrough

The changes update how the Python Ellipsis object is accessed and returned across multiple modules. Instead of using a dedicated accessor method, the code now directly clones the ellipsis object field and converts it as needed. The ellipsis() method was removed from the Context implementation, and all usages were updated to use cloning and conversion directly.

Changes

File(s) Change Summary
vm/src/builtins/code.rs Modified to clone and convert ctx.ellipsis directly instead of calling ctx.ellipsis().
vm/src/stdlib/ast/constant.rs Updated to clone and convert vm.ctx.ellipsis directly instead of calling vm.ctx.ellipsis().
vm/src/stdlib/marshal.rs Changed to clone and convert self.0.ctx.ellipsis directly, replacing previous accessor usage.
vm/src/vm/context.rs Removed the ellipsis() method from the Context implementation.

Poem

In the land of code, the ellipsis hops,
No longer fetched by method stops.
Now cloned and owned, it leaps anew,
Through marshals, ASTs, and code review.
A bunny’s joy—less hops to make,
For every dot, a cleaner wake!


📜 Recent review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1d36034 and 2ca30ec.

📒 Files selected for processing (4)
  • vm/src/builtins/code.rs (1 hunks)
  • vm/src/stdlib/ast/constant.rs (1 hunks)
  • vm/src/stdlib/marshal.rs (1 hunks)
  • vm/src/vm/context.rs (0 hunks)
💤 Files with no reviewable changes (1)
  • vm/src/vm/context.rs
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .github/copilot-instructions.md
🔇 Additional comments (3)
vm/src/stdlib/ast/constant.rs (1)

164-164: LGTM: Consistent refactoring to remove ellipsis() method

The change from method call to direct field access with explicit cloning and conversion is clean and maintains the same functionality while being more explicit about the operations performed.

vm/src/stdlib/marshal.rs (1)

141-141: LGTM: Consistent with the ellipsis() method removal

The change follows the same pattern as other files in this PR, directly accessing the ellipsis field with explicit cloning and conversion. This maintains functionality while removing the dependency on the deprecated method.

vm/src/builtins/code.rs (1)

146-146: LGTM: Completes the ellipsis() method removal refactoring

The change is consistent with the other files in this PR, replacing the method call with direct field access and explicit cloning. This maintains the same functionality while removing the dependency on the deprecated ellipsis() method.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@youknowone youknowone merged commit 2dd0ce5 into RustPython:main Jul 15, 2025
22 of 23 checks passed
@youknowone youknowone deleted the ellipsis branch July 15, 2025 07:10
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