mirror of
https://github.com/python/cpython.git
synced 2025-07-15 23:35:23 +00:00
Move UserList to collections.
This commit is contained in:
parent
4513ef8b7a
commit
53dbe39b46
14 changed files with 133 additions and 143 deletions
|
@ -1,7 +1,7 @@
|
|||
import gc
|
||||
import sys
|
||||
import unittest
|
||||
import UserList
|
||||
import collections
|
||||
import weakref
|
||||
|
||||
from test import test_support
|
||||
|
@ -157,7 +157,7 @@ class ReferencesTestCase(TestBase):
|
|||
o = C()
|
||||
self.check_proxy(o, weakref.proxy(o))
|
||||
|
||||
L = UserList.UserList()
|
||||
L = collections.UserList()
|
||||
p = weakref.proxy(L)
|
||||
self.failIf(p, "proxy for empty UserList should be false")
|
||||
p.append(12)
|
||||
|
@ -171,11 +171,11 @@ class ReferencesTestCase(TestBase):
|
|||
p[1] = 5
|
||||
self.assertEqual(L[1], 5)
|
||||
self.assertEqual(p[1], 5)
|
||||
L2 = UserList.UserList(L)
|
||||
L2 = collections.UserList(L)
|
||||
p2 = weakref.proxy(L2)
|
||||
self.assertEqual(p, p2)
|
||||
## self.assertEqual(repr(L2), repr(p2))
|
||||
L3 = UserList.UserList(range(10))
|
||||
L3 = collections.UserList(range(10))
|
||||
p3 = weakref.proxy(L3)
|
||||
self.assertEqual(L3[:], p3[:])
|
||||
self.assertEqual(L3[5:], p3[5:])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue