Add more dict functions to c-api#8269
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe dictionary C-API gains clear, string-key set/delete, object-key lookup, and string-key lookup functions. String keys are decoded from C strings, with invalid UTF-8 handled according to each API’s return contract. ChangesDictionary C-API
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
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/dictobject.rs`:
- Around line 90-110: Update PyDict_GetItemString so CStr::to_str() failures
propagate an appropriate decode exception through the existing with_vm result
instead of returning Ok(null_mut()). Preserve Ok(None) as the lookup-miss path,
but stop swallowing errors from dict.inner_getitem_opt; only lookup misses
should return a null pointer without an exception.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 8701ac58-1d3c-4a57-b681-83a4a95747cd
📒 Files selected for processing (1)
crates/capi/src/dictobject.rs
60e37fd to
3db5877
Compare
Summary by CodeRabbit
New Features
clear,set,get, anddeleteoperations.char*key variants for string-key interop, including a reference-style lookup with a hit/miss success flag.Bug Fixes