mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Used sets.Set() to compare unordered sequences.
Improves clarity and brevity.
This commit is contained in:
parent
40006e9f7a
commit
91bbd9a7b9
6 changed files with 17 additions and 40 deletions
|
@ -4,6 +4,7 @@ import UserList
|
|||
import weakref
|
||||
|
||||
from test import test_support
|
||||
from sets import Set
|
||||
|
||||
|
||||
class C:
|
||||
|
@ -340,9 +341,7 @@ class MappingTestCase(TestBase):
|
|||
"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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue