Update the migration of Set, Enum, Range (Does not matter anymore), and itertools.batched and pairwise#99
Open
CaQtiml wants to merge 52 commits intofxpl:old-regions-main3from
Open
Conversation
Regions main
Cown: Add new tests for releasing open regions
Regions: Correct off-by-one LRC and Cown release code
…d cpython from mjp41
Regions main
…or "range". Should test with test1_4.py
…_sequence do not need the migration. also migrate _PySlice_GetLongIndices, slice_dealloc, and slice_new since they are related to range_as_mapping
Regions main
Regions main
Regions main
Regions main
Regions: Correct `_PyRegion_AddRefsArray()` write barrier
Regions main
Regions: Add `PyRegion_ShareRegion` function
Regions main
… a problem, but commit as a progress update. Update unit test and test case for setior
…Clean code in rangeobject.c
…k it is correct as of now)
Regions main
Regions main
Merge pull request #14 from fxpl/regions-main
xFrednet
reviewed
Apr 7, 2026
| Py_hash_t hash = _PyObject_HashFast(key); | ||
| if (hash == -1) { | ||
| set_unhashable_type(key); | ||
| Py_DECREF(key); |
| // We don't pre-increment here, the caller holds a strong | ||
| // reference to the object which we are stealing. | ||
| return set_add_entry_takeref(so, key, hash); | ||
| return set_add_entry_takeref(so, key, hash, false); |
Collaborator
There was a problem hiding this comment.
IDK, but it looks like it should be
Suggested change
| return set_add_entry_takeref(so, key, hash, false); | |
| return set_add_entry_takeref(so, key, hash, true); |
??
Comment on lines
+638
to
+643
| PyObject *entry_key = PyRegion_NewRef(entry->key); | ||
| if(entry_key == NULL) { | ||
| Py_DECREF(keys); | ||
| goto done; | ||
| } | ||
| PyList_SET_ITEM(keys, idx++, entry_key); |
Collaborator
There was a problem hiding this comment.
NIT: All of this is safe because keys is local, an assert and doc comment to explain this would be good
Objects/setobject.c
Outdated
| return NULL; | ||
| } | ||
| Py_SETREF(result, newresult); | ||
| PyRegion_XSETLOCALREF(result, newresult); |
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.
No description provided.