Repository navigation
Conversation
Signed-off-by: Sungmin Park <ryan040@korea.ac.kr>
This branch has not been deployed
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.
Description
Fixes #1393
HashingStorageDelItem.domStringKeyhashed a key that is not a built-instrand then reported it as not found. On the dicts that use aDynamicObjectStorage(a module's__dict__,globals(), the dictlocals()returns),del d[k]andd.pop(k)therefore raisedKeyErrorfor a key equal to one of the string keys, althoughd[k]found it. Getting an item already compares such a key with the string keys inDynamicObjectStorage.GetItemNoStringKeyNode.AS-IS
TO-BE
(matching CPython)
Changes
HashingStorageDelItem.domStringKey, for a key that is not a built-instr, look for a string key with the same hash that compares equal, asGetItemNoStringKeyNodedoes, and delete that key.test_module_dict_del_non_str_key_equal_to_str_keytotests/test_dict.py:popanddelwith such a key on a module's__dict__and onlocals(),popreturning the default once the key is gone, andKeyErrorfromdelfor a missing key. It passes on CPython 3.12, 3.13 and 3.14.Testing
mx buildon darwin-aarch64 (master 3176851), thenmx graalpytest test_dict(85 passed) and--taggedtest_dict(101),test_module(36) andtest_scope(37). Without the change, the new test fails at the firstpop.mx checkstyle --primaryandmx eclipseformat --primaryreport nothing.