Skip to content

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

Merged
serhiy-storchaka merged 5 commits into
python:masterfrom
corona10:bpo-38210
Oct 6, 2019
Merged

bpo-38210: Remove intersection operation with empty set#16602
serhiy-storchaka merged 5 commits into
python:masterfrom
corona10:bpo-38210

Conversation

@corona10

@corona10 corona10 commented Oct 6, 2019

Copy link
Copy Markdown
Member

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

Comment thread Lib/test/test_dictviews.py Outdated
Comment thread Lib/test/test_dictviews.py Outdated
@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