Used sets.Set() to compare unordered sequences.
Improves clarity and brevity.
diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py
index 66e6eeb..e9cb093 100644
--- a/Lib/test/test___all__.py
+++ b/Lib/test/test___all__.py
@@ -2,6 +2,7 @@
 from test import test_support
 
 from test.test_support import verify, verbose
+from sets import Set
 import sys
 import warnings
 
@@ -42,10 +43,8 @@
         exec "from %s import *" % modname in names
         if names.has_key("__builtins__"):
             del names["__builtins__"]
-        keys = names.keys()
-        keys.sort()
-        all = list(sys.modules[modname].__all__) # in case it's a tuple
-        all.sort()
+        keys = Set(names)
+        all = Set(sys.modules[modname].__all__)
         verify(keys==all, "%s != %s" % (keys, all))
 
     def test_all(self):
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index 505da70..97786ad 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -2,6 +2,7 @@
 
 import test.test_support, unittest
 from test.test_support import fcmp, have_unicode, TESTFN, unlink
+from sets import Set
 
 import sys, warnings, cStringIO
 warnings.filterwarnings("ignore", "hex../oct.. of negative int",
@@ -1159,18 +1160,9 @@
     get_vars_f2 = staticmethod(get_vars_f2)
 
     def test_vars(self):
-        a = b = None
-        a = vars().keys()
-        b = dir()
-        a.sort()
-        b.sort()
-        self.assertEqual(a, b)
+        self.assertEqual(Set(vars()), Set(dir()))
         import sys
-        a = vars(sys).keys()
-        b = dir(sys)
-        a.sort()
-        b.sort()
-        self.assertEqual(a, b)
+        self.assertEqual(Set(vars(sys)), Set(dir(sys)))
         self.assertEqual(self.get_vars_f0(), {})
         self.assertEqual(self.get_vars_f2(), {'a': 1, 'b': 2})
         self.assertRaises(TypeError, vars, 42, 42)
diff --git a/Lib/test/test_glob.py b/Lib/test/test_glob.py
index cfc3077..a06ce9d 100644
--- a/Lib/test/test_glob.py
+++ b/Lib/test/test_glob.py
@@ -2,6 +2,7 @@
 from test.test_support import run_unittest, TESTFN
 import glob
 import os
+from sets import Set
 
 def mkdirs(fname):
     if os.path.exists(fname) or fname == '':
@@ -61,11 +62,7 @@
         return glob.glob(p)
 
     def assertSequencesEqual_noorder(self, l1, l2):
-        l1 = list(l1)
-        l2 = list(l2)
-        l1.sort()
-        l2.sort()
-        self.assertEqual(l1, l2)
+        self.assertEqual(Set(l1), Set(l2))
 
     def test_glob_literal(self):
         eq = self.assertSequencesEqual_noorder
diff --git a/Lib/test/test_pyclbr.py b/Lib/test/test_pyclbr.py
index 7a59c2e..1229962 100644
--- a/Lib/test/test_pyclbr.py
+++ b/Lib/test/test_pyclbr.py
@@ -7,6 +7,7 @@
 from types import ClassType, FunctionType, MethodType
 import pyclbr
 from unittest import TestCase
+from sets import Set
 
 # This next line triggers an error on old versions of pyclbr.
 
@@ -23,17 +24,10 @@
 
     def assertListEq(self, l1, l2, ignore):
         ''' succeed iff {l1} - {ignore} == {l2} - {ignore} '''
-        l1.sort()
-        l2.sort()
-        try:
-            for p1, p2 in (l1, l2), (l2, l1):
-                for item in p1:
-                    ok = (item in p2) or (item in ignore)
-                    if not ok:
-                        self.fail("%r missing" % item)
-        except:
+        missing = (Set(l1) ^ Set(l2)) - Set(ignore)
+        if missing:
             print >>sys.stderr, "l1=%r\nl2=%r\nignore=%r" % (l1, l2, ignore)
-            raise
+            self.fail("%r missing" % missing.pop())
 
     def assertHasattr(self, obj, attr, ignore):
         ''' succeed iff hasattr(obj,attr) or attr in ignore. '''
diff --git a/Lib/test/test_userdict.py b/Lib/test/test_userdict.py
index bcf60a5..399ddda 100644
--- a/Lib/test/test_userdict.py
+++ b/Lib/test/test_userdict.py
@@ -1,6 +1,7 @@
 # Check every path through every method of UserDict
 
 import test.test_support, unittest
+from sets import Set
 
 import UserDict
 
@@ -68,10 +69,7 @@
             self.assert_(hasattr(iter, 'next'))
             self.assert_(hasattr(iter, '__iter__'))
             x = list(iter)
-            x.sort()
-            lst.sort()
-            ref.sort()
-            self.assert_(x==lst==ref)
+            self.assert_(Set(x)==Set(lst)==Set(ref))
         check_iterandlist(d.iterkeys(), d.keys(), self.reference.keys())
         check_iterandlist(iter(d), d.keys(), self.reference.keys())
         check_iterandlist(d.itervalues(), d.values(), self.reference.values())
@@ -243,10 +241,8 @@
         ikeys = []
         for k in u2:
             ikeys.append(k)
-        ikeys.sort()
         keys = u2.keys()
-        keys.sort()
-        self.assertEqual(ikeys, keys)
+        self.assertEqual(Set(ikeys), Set(keys))
 
         # Test setdefault
         t = UserDict.UserDict()
diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py
index eb87720..7e7d068 100644
--- a/Lib/test/test_weakref.py
+++ b/Lib/test/test_weakref.py
@@ -4,6 +4,7 @@
 import weakref
 
 from test import test_support
+from sets import Set
 
 
 class C:
@@ -340,9 +341,7 @@
                          "wrong object returned by weak dict!")
         items1 = dict.items()
         items2 = dict.copy().items()
-        items1.sort()
-        items2.sort()
-        self.assert_(items1 == items2,
+        self.assert_(Set(items1) == Set(items2),
                      "cloning of weak-keyed dictionary did not work!")
         del items1, items2
         self.assert_(len(dict) == self.COUNT)