Skip to content

Conversation

youknowone
Copy link
Member

@youknowone youknowone commented Sep 4, 2025

close #6098
close #6101

Technically #6101 can be a solution of #6098, but we have to set a limitation.
Practically 6 is a good point due to harmony of other Rust ecosystem like clippy

Summary by CodeRabbit

  • Documentation
    • Clarified limitations on passing function arguments via tuples, noting support for up to six unnamed positional arguments.
    • Recommended using a struct with a derive-based argument parser for more complex argument parsing.
    • Added references to guidance for choosing the appropriate approach.
    • No functional or API changes; behavior remains the same.

Copy link
Contributor

coderabbitai bot commented Sep 4, 2025

Walkthrough

Adds documentation comments in vm/src/function/argument.rs after into_func_args_from_tuple! macro invocations, clarifying current support for six unnamed positional arguments, suggesting using #[derive(FromArgs)] for complex parsing, and noting a Clippy-related limitation with a reference link. No functional or API changes.

Changes

Cohort / File(s) Summary
Docs: argument handling comments
vm/src/function/argument.rs
Added documentation comments explaining current positional-arg limits, recommending #[derive(FromArgs)], and noting a Clippy lint limitation. No code or signature changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Assessment against linked issues

Objective Addressed Explanation
Increase parameter limit for IntoPyNativeFn beyond 7 params (#6098) No implementation changes to extend arity; only comments added.
Expand arg tuple handling to 12 and IntoPyNativeFn to 11 params (#6101) No macro or trait expansions present; only documentation updates.

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Added documentation comments about arg limits and Clippy rationale (vm/src/function/argument.rs) Documentation-only edit does not implement increased arity requested in #6098/#6101; unrelated to the functional objectives.

Poem

I thump my paws on lines so neat,
A note about the args we meet—
Six in a row, then pause, refrain,
“Use structs,” I scribble, clear and plain.
No code now grows, but docs take flight—
Carrots of comment, crisp and bright. 🥕

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • 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
🪧 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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit 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.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
vm/src/function/argument.rs (3)

58-61: Tighten wording and fix grammar; clarify the lint reference.

Small nits to improve clarity and correctness.

-// We currently allows only 6 unnamed positional arguments.
-// Please use `#[derive(FromArgs)]` and a struct for more complex argument parsing.
-// The number of limitation came from:
-//
-// https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
+// We currently allow only 6 unnamed positional arguments.
+// For more complex argument parsing, prefer `#[derive(FromArgs)]` on a struct.
+// This limit follows Clippy's `too_many_arguments` lint:
+// https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

585-596: Comment says “7-tuples” but code implements up to 8 (A..H).

Either update the comment to “8-tuples” or drop the H expansion. Prefer updating the comment for accuracy.

-// Implement `FromArgs` for up to 7-tuples, allowing built-in functions to bind
-// up to 7 top-level parameters (note that `PosArgs`, `KwArgs`, nested tuples, etc.
+// Implement `FromArgs` for up to 8-tuples, allowing built-in functions to bind
+// up to 8 top-level parameters (note that `PosArgs`, `KwArgs`, nested tuples, etc.

63-66: Minor typo in doc comment.

“then creating” → “when creating”.

-/// The `FuncArgs` struct is one of the most used structs then creating
+/// The `FuncArgs` struct is one of the most used structs when creating
📜 Review details

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 0c8ae3a and 9f475f4.

📒 Files selected for processing (1)
  • vm/src/function/argument.rs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.rs: Follow the default rustfmt code style (cargo fmt to format)
Always run clippy to lint code (cargo clippy) before completing tasks. Fix any warnings or lints that are introduced by your 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:

  • vm/src/function/argument.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: Run snippets and cpython tests on wasm-wasi
  • GitHub Check: Run tests under miri
  • GitHub Check: Run snippets and cpython tests (windows-latest)
  • GitHub Check: Check the WASM package and demo
  • GitHub Check: Run rust tests (windows-latest)
  • GitHub Check: Run rust tests (macos-latest)
  • GitHub Check: Run snippets and cpython tests (macos-latest)
  • GitHub Check: Run snippets and cpython tests (ubuntu-latest)
  • GitHub Check: Run rust tests (ubuntu-latest)
  • GitHub Check: Check Rust code with rustfmt and clippy
  • GitHub Check: Ensure compilation on various targets

Copy link
Member

@coolreader18 coolreader18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable 👍

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.

Increase parameter limit for trait beyond 7 argumentsIntoPyNativeFn
2 participants