Skip to content

Commit 26858aa

Browse files
committed
[GR-12856] There is no _cvs module.
PullRequest: graalpython/327
2 parents 8f5b0b7 + f6ea505 commit 26858aa

File tree

2 files changed

+608
-0
lines changed

2 files changed

+608
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/dict/DictViewBuiltins.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
import com.oracle.graal.python.builtins.objects.common.SequenceStorageNodes;
6868
import com.oracle.graal.python.builtins.objects.dict.PDictView.PDictItemsView;
6969
import com.oracle.graal.python.builtins.objects.dict.PDictView.PDictKeysView;
70+
import com.oracle.graal.python.builtins.objects.list.PList;
7071
import com.oracle.graal.python.builtins.objects.set.PBaseSet;
7172
import com.oracle.graal.python.builtins.objects.set.PSet;
7273
import com.oracle.graal.python.builtins.objects.set.SetNodes;
@@ -256,6 +257,16 @@ PBaseSet doItemsView(PDictItemsView self, PDictItemsView other,
256257
HashingStorage storage = diffNode.execute(selfSet.getDictStorage(), otherSet.getDictStorage());
257258
return factory().createSet(storage);
258259
}
260+
261+
@Specialization
262+
PBaseSet doItemsView(PDictKeysView self, PList other,
263+
@Cached("create()") HashingStorageNodes.DiffNode diffNode,
264+
@Cached("create()") SetNodes.ConstructSetNode constructSetNode) {
265+
PSet selfSet = constructSetNode.executeWith(self);
266+
PSet otherSet = constructSetNode.executeWith(other);
267+
HashingStorage storage = diffNode.execute(selfSet.getDictStorage(), otherSet.getDictStorage());
268+
return factory().createSet(storage);
269+
}
259270
}
260271

261272
@Builtin(name = __AND__, fixedNumOfPositionalArgs = 2)

0 commit comments

Comments
 (0)