Skip to content

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

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

Merged
merged 5 commits into from
Oct 6, 2019

Conversation

corona10
Copy link
Member

@corona10 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

@corona10 corona10 added the type-bug An unexpected behavior, bug, or error label Oct 6, 2019
@serhiy-storchaka serhiy-storchaka merged commit c38e725 into python:master Oct 6, 2019
@corona10 corona10 deleted the bpo-38210 branch October 6, 2019 11:44
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.

4 participants