| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
WalkthroughUpdates ignore patterns in .gitignore. Adjusts unicodedata::name to emit a different ValueError message when no name is found with a default provided. Removes the Python-exposed is_integer method from PyInt, retaining an internal const version; bit_count remains unchanged. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.
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 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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
Status, Documentation and Community
|
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1).gitignore (1)📜 Review details24-28: Clarify ignore depth and anchor patterns for Lib/site-packages and Lib/test/data
If the intent is to ignore everything under these directories recursively (not just direct children), prefer anchoring to repo root and using **. Keeps the single README files tracked.
Would you like these patterns to apply recursively? If yes, apply:
-Lib/site-packages/* -!Lib/site-packages/README.txt -Lib/test/data/* -!Lib/test/data/README +/Lib/site-packages/** +!/Lib/site-packages/README.txt +/Lib/test/data/** +!/Lib/test/data/README
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration.
📥 CommitsReviewing files that changed from the base of the PR and between 5c6f92d and e7c8796.
⛔ Files ignored due to path filters (35)📄 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:
compiler/literal/src/float.rs (1)⏰ 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)vm/src/builtins/float.rs (1)
- is_integer (25-27)
- is_integer (480-482)
stdlib/src/unicodedata.rs (1)vm/src/builtins/int.rs (1)148-149: LGTM: ValueError message updated to match CPython behavior
Returning the provided default when no name is found, and otherwise raising ValueError("no such name") aligns with CPython’s expectations for unicodedata.name.
693-693: bit_count remains correctly exposed
bit_count() implementation is consistent with Python’s API and semantics.
Sorry, something went wrong.
| const fn is_integer(&self) -> bool { | ||
| true | ||
| } | ||
|
|
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chainDo not expose int.is_integer() to Python
int in CPython does not have an is_integer() method; exposing it breaks compatibility and likely contradicts the updated tests. If you need this helper internally, keep it as a non-#[pymethod] function in a non-pyclass impl block; otherwise, remove it.
Apply this diff to stop exporting it to Python:
- #[pymethod]
- const fn is_integer(&self) -> bool {
- true
- }Optionally, if an internal helper is desired elsewhere in the crate, add (outside the #[pyclass] impl):
impl PyInt {
pub const fn is_integer(&self) -> bool {
true
}
}Run to confirm nothing else exposes is_integer for int:
🏁 Script executed:
#!/bin/bash
# grep for Python-visible int.is_integer definitions/usages
rg -n --type=rust -C2 '(?m)^\s*#\s*\[pymethod\]\s*\n\s*const?\s+fn\s+is_integer\b' vm/src
rg -n --type=python -C2 "hasattr\\([^,]+,\\s*['\\\"]is_integer['\\\"]\\)" Lib/test || trueLength of output: 501
To ensure we didn’t miss any Python-exposed is_integer methods or references, let’s rerun with a corrected regex:
🏁 Script executed:
#!/bin/bash
# Search for any #[pymethod] const fn is_integer in Rust
rg -n -U --type=rust '#\[pymethod\]\s*const\s+fn\s+is_integer' vm/src
# Search for any usage of .is_integer() in Python tests
rg -n --type=python '\.is_integer\s*\(' Lib/testLength of output: 264
Remove Python exposure of int.is_integer()
The #[pymethod] const fn is_integer(&self) -> bool { … } on lines 688–689 of vm/src/builtins/int.rs is still being exposed to Python. In CPython, int has no is_integer() method, so this breaks compatibility.
Please apply the following diff to stop exporting it:
--- a/vm/src/builtins/int.rs
+++ b/vm/src/builtins/int.rs
@@ impl PyInt {
- #[pymethod]
- const fn is_integer(&self) -> bool {
- true
- }If you still need this helper internally, add it outside the #[pyclass] impl as a plain Rust method:
impl PyInt {
pub const fn is_integer(&self) -> bool {
true
}
}In vm/src/builtins/int.rs around lines 689–692, the const fn is_integer(&self)
is currently exposed to Python via #[pymethod] inside the #[pyclass] impl which
is incompatible with CPython; remove the #[pymethod] export (delete the method
from the pyclass impl) and, if the functionality is still needed internally, add
a plain Rust method on PyInt outside the #[pyclass] impl (e.g., impl PyInt { pub
const fn is_integer(&self) -> bool { true } }) so it is available in Rust but
not exported to Python.
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks!
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
I can split this PR if it's too big
Summary by CodeRabbit