#!/usr/bin/env python
# -*- coding: utf-8 -*-

from runner.koan import *


class AboutSets(Koan):
    def test_sets_make_keep_lists_unique(self):
        highlanders = ['MacLeod', 'Ramirez', 'MacLeod', 'Matunas',
            'MacLeod', 'Malcolm', 'MacLeod']

        there_can_only_be_only_one = set(highlanders)

        self.assertEqual(__, there_can_only_be_only_one)

    def test_sets_are_unordered(self):
        self.assertEqual(set([__, __, __, __, __]), set('12345'))

    def test_convert_the_set_into_a_list_to_sort_it(self):
        self.assertEqual(__, sorted(set('13245')))

    # ------------------------------------------------------------------

    def test_set_have_arithmetic_operators(self):
        scotsmen = set(['MacLeod', 'Wallace', 'Willie'])
        warriors = set(['MacLeod', 'Wallace', 'Leonidas'])

        self.assertEqual(__, scotsmen - warriors)
        self.assertEqual(__, scotsmen | warriors)
        self.assertEqual(__, scotsmen & warriors)
        self.assertEqual(__, scotsmen ^ warriors)

    # ------------------------------------------------------------------

    def test_we_can_query_set_membership(self):
        self.assertEqual(__, 127 in set([127, 0, 0, 1]))
        self.assertEqual(__, 'cow' not in set('apocalypse now'))

    def test_we_can_compare_subsets(self):
        self.assertEqual(__, set('cake') <= set('cherry cake'))
        self.assertEqual(__, set('cake').issubset(set('cherry cake')))

        self.assertEqual(__, set('cake') > set('pie'))

@@ -332,18 +332,65 @@
 rtEqual(
-__
+set(%5B'MacLeod', 'Ramirez', 'Matunas', 'Malcolm'%5D)
 , there_
@@ -485,26 +485,31 @@
 et(%5B
-__, __, __, __, __
+'1', '3', '2', '5', '4'
 %5D), 
@@ -607,18 +607,37 @@
 rtEqual(
-__
+%5B'1','2','3','4','5'%5D
 , sorted
@@ -911,34 +911,47 @@
 elf.assertEqual(
-__
+set(%5B'Willie'%5D)
 , scotsmen - war
@@ -974,34 +974,81 @@
 elf.assertEqual(
-__
+set(%5B'MacLeod', 'Wallace', 'Willie', 'Leonidas'%5D)
 , scotsmen %7C war
@@ -1071,34 +1071,59 @@
 elf.assertEqual(
-__
+set(%5B'MacLeod', 'Wallace'%5D)
 , scotsmen & war
@@ -1154,18 +1154,43 @@
 rtEqual(
-__
+set(%5B'Willie', 'Leonidas'%5D)
 , scotsm
@@ -1352,18 +1352,20 @@
 rtEqual(
-__
+True
 , 127 in
@@ -1411,18 +1411,20 @@
 rtEqual(
-__
+True
 , 'cow' 
@@ -1514,34 +1514,36 @@
 elf.assertEqual(
-__
+True
 , set('cake') %3C=
@@ -1580,34 +1580,36 @@
 elf.assertEqual(
-__
+True
 , set('cake').is
@@ -1666,10 +1666,13 @@
 ual(
-__
+False
 , se

Update about_sets.py