From 1ff6011abc47cb3a42ed89c9c682ac8a0af6b092 Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Mon, 7 Apr 2014 05:00:03 +0100 Subject: Modify set tests to print sorted sets directly instead of creating temporary lists and sorting those in-place --- tests/basics/set_intersection.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'tests/basics/set_intersection.py') 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)) -- cgit v1.2.3