GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Add more int functions to the c-api by bschoenmaeckers · Pull Request #8159 · RustPython/RustPython Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughExpanded the PyLong C-API with new constructors and extractors, extended integer FfiResult outputs, and changed PyInt unsigned mask handling. ChangesPyLong C-API expansion
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
6aa3a82 to
3d85bb2
Compare
|
@coderabbitai resume |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
✅ Action performedReviews resumed. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
3d85bb2 to
2a94827
Compare
| #[must_use] | ||
| pub fn as_u64_mask(&self) -> u64 { | ||
| let v = self.as_bigint(); | ||
| v.to_u64() |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I didn't investigate the detail yet, but trying to_u64 looks like redundant operation if the fallback still use the last digits
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Looking at the simplified logic this feels redundant.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I've also applied this to the u32 function
Sorry, something went wrong.
There was an error while loading. Please reload this page.
acec52f to
b8835a8
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/capi/src/longobject.rs`:
- Around line 92-106: The flag parsing in
AsNativeBytesFlags::from_bits_or_default currently accepts the reserved endian
value 2 because it passes through AsNativeBytesFlags::from_bits; add an explicit
rejection for that raw flag before the generic bitmask check so
PyLong_FromNativeBytes and PyLong_FromUnsignedNativeBytes raise ValueError for 2
while still preserving the existing default behavior for -1. Keep the Default
implementation unchanged, since Self::NATIVE_ENDIAN | Self::UNSIGNED_BUFFER is
correct, and ensure the new validation is localized to from_bits_or_default so
both call sites inherit it automatically.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: e0d68fea-f4dd-4ac0-9ab6-740c9eee9e6b
Cargo.lock is excluded by !**/*.lockcrates/capi/Cargo.tomlcrates/capi/src/longobject.rs
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
4cf4334 to
ad92c2c
Compare
|
@coderabbitai resume |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
✅ Action performedReviews resumed. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
2bffd0c to
18e54a6
Compare
18e54a6 to
4ad78c4
Compare
4ad78c4 to
18f4929
Compare
There was an error while loading. Please reload this page.
* Add more int functions to the c-api * Simplify as_mask logic * Add `PyLong_FromNativeBytes` & `PyLong_FromUnsignedNativeBytes`
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.