Update atomlist#270
Merged
MatthieuDartiailh merged 1 commit intonucleic:mainfrom May 8, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #270 +/- ##
=======================================
Coverage 97.52% 97.52%
=======================================
Files 24 24
Lines 1093 1093
Branches 167 167
=======================================
Hits 1066 1066
Misses 13 13
Partials 14 14 🚀 New features to boost your workflow:
|
| return 0; | ||
| PyList_SET_ITEM( templist.get(), i, cppy::incref( val ) ); | ||
| PyList_SET_ITEM( templist.get(), i, val ); | ||
| Py_DECREF( b ); // Release old reference |
Member
There was a problem hiding this comment.
PyList_GET_ITEM return a borrowed reference but PyList_SET_ITEM does not decrement the ref count of the replaced object. So this is correct but really deserves a comment.
Contributor
Author
There was a problem hiding this comment.
Agreed. Added a comment there to clarify.
Contributor
Author
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes a leak in validate_sequence, updates insert & pop to use vectorcalls, and cleans up some outdated version guards.
Since full_validate already returns a new reference it does not need an extra incref, it just gets stolen by the list. PySequence_List returns a populated copy of the items. PyList_SET_ITEM is intended to be used with PyList_New so it does not discard the old item meaning the old item was leaked.