Skip to content

Conversation

@sweeneyde
Copy link
Member

@sweeneyde sweeneyde commented Feb 13, 2022

Ensure strong references are acquired whenever using set_next(). Added randomized test cases for __eq__ methods that sometimes mutate sets when called.

(cherry picked from commit 4a66615)

https://bugs.python.org/issue46615

…31120)

Ensure strong references are acquired whenever using `set_next()`. Added randomized test cases for `__eq__` methods that sometimes mutate sets when called.

(cherry picked from commit 4a66615)
key = entry->key;
hash = entry->hash;
Py_INCREF(key);
rv = _PyDict_Contains(other, key, hash);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: cherry-picker only struggled because this is _PyDict_Contains_KnownHash() in main.

@serhiy-storchaka serhiy-storchaka merged commit c31b8a9 into python:3.9 Feb 13, 2022
@sweeneyde sweeneyde deleted the backport-4a66615-3.9 branch February 13, 2022 18:18
hello-adam pushed a commit to hello-adam/cpython that referenced this pull request Jun 2, 2022
…31120) (pythonGH-31312)

Ensure strong references are acquired whenever using `set_next()`. Added randomized test cases for `__eq__` methods that sometimes mutate sets when called.

(cherry picked from commit 4a66615)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants