summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/set_intersection.py
diff options
context:
space:
mode:
authorAndrew Scheller <github@loowis.durge.org>2014-04-07 05:00:03 +0100
committerAndrew Scheller <github@loowis.durge.org>2014-04-07 05:00:03 +0100
commit1ff6011abc47cb3a42ed89c9c682ac8a0af6b092 (patch)
tree24af0b18cf1602f7a9292e39644f0f70d8c647ac /tests/basics/set_intersection.py
parent2bfd2dc77091bee94723c36216dee652bcc8a054 (diff)
downloadmicropython-1ff6011abc47cb3a42ed89c9c682ac8a0af6b092.tar.gz
micropython-1ff6011abc47cb3a42ed89c9c682ac8a0af6b092.zip
Modify set tests to print sorted sets directly
instead of creating temporary lists and sorting those in-place
Diffstat (limited to 'tests/basics/set_intersection.py')
-rw-r--r--tests/basics/set_intersection.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/tests/basics/set_intersection.py b/tests/basics/set_intersection.py
index 6f3dfc7414..73804c840d 100644
--- a/tests/basics/set_intersection.py
+++ b/tests/basics/set_intersection.py
@@ -1,12 +1,7 @@
-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(sorted(s))
+print(sorted(s.intersection({1, 3})))
+print(sorted(s.intersection([3, 4])))
print(s.intersection_update([1]))
-report(s)
+print(sorted(s))