[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light
/ cpython Public
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-38210: Remove intersection operation with empty set #16602

Merged
merged 5 commits into from Oct 6, 2019

Conversation

Copy link
Member

corona10 commented Oct 6, 2019

There was an unnecessary logic with the empty set.
The logic can be represented by blow code in pure python

result = set() # result = PySet_New(NULL);
it = iter(other)
result.intersection_update(other) 
# result will be empty set and iterator is fully consumed.
# so this logic should be removed

https://bugs.python.org/issue38210

Lib/test/test_dictviews.py Outdated Show resolved Hide resolved
Lib/test/test_dictviews.py Outdated Show resolved Hide resolved
corona10 added the type-bug An unexpected behavior, bug, or error label Oct 6, 2019
serhiy-storchaka merged commit c38e725 into python:master Oct 6, 2019
corona10 deleted the bpo-38210 branch Oct 6, 2019
jacobneiltaylor pushed a commit to jacobneiltaylor/cpython that referenced this pull request Dec 5, 2019
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.

None yet

4 participants