summaryrefslogtreecommitdiff
path: root/tests/basics
diff options
context:
space:
mode:
authorJohn R. Lenton <jlenton@gmail.com>2014-01-12 17:54:03 +0000
committerJohn R. Lenton <jlenton@gmail.com>2014-01-12 17:54:03 +0000
commitf1ae6b48fbc88d4acdbe1136f56c136f8e1b2991 (patch)
tree831d0da417f1267e79e594acec5fd76752ff2256 /tests/basics
parent032129f3b595f132046b9f4c6f108f1677aef944 (diff)
Implemented set.intersection and set.intersection_update
Diffstat (limited to 'tests/basics')
-rw-r--r--tests/basics/tests/set_intersection.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/basics/tests/set_intersection.py b/tests/basics/tests/set_intersection.py
new file mode 100644
index 000000000..6f3dfc741
--- /dev/null
+++ b/tests/basics/tests/set_intersection.py
@@ -0,0 +1,12 @@
+def report(s):
+ l = list(s)
+ l.sort()
+ print(l)
+
+s = {1, 2, 3, 4}
+report(s)
+report(s.intersection({1, 3}))
+report(s.intersection([3, 4]))
+
+print(s.intersection_update([1]))
+report(s)