Repository navigation
Pass owned iterables straight into PyIter - #8805
Conversation
GET_ITER, GET_YIELD_FROM_ITER, mapping keys(), and builtin iter() already hold a PyObjectRef. get_iter() cloned it before try_from_object. Assisted-by: Grok CLI:grok-4.7
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: RustPython/RustPython/.coderabbit.yml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughFour iterator-creation call sites now use ChangesIterator construction
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~5 minutes Change: Refactor Merge Risk: ⚪ Minimal · up to This change avoids an intermediate reference clone while preserving iterator conversion behavior. No merge-blocking risk is identified; it is ready for normal checks. 🚥 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 |
One of checkbox below must be checked.
Summary
GET_ITER,GET_YIELD_FROM_ITER,**mappingkeys(), and builtiniter()already hold aPyObjectRef. They calledPyObject::get_iter, which cloned the object beforePyIter::try_from_object. Pass the owned value through instead.get_iterstays for callers that only have a borrow.Summary by CodeRabbit
iterfunction now uses a consistent conversion path. Objects that cannot be used as iterators may receive different type-validation behavior when passed to these operations.