mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
* teach repr.repr() about collections.deque()
* rename a variable for clarity
This commit is contained in:
parent
ba6cd3647f
commit
1453e4aa75
2 changed files with 10 additions and 2 deletions
|
@ -35,6 +35,7 @@ class ReprTests(unittest.TestCase):
|
|||
|
||||
def test_container(self):
|
||||
from array import array
|
||||
from collections import deque
|
||||
|
||||
eq = self.assertEquals
|
||||
# Tuples give up after 6 elements
|
||||
|
@ -65,6 +66,9 @@ class ReprTests(unittest.TestCase):
|
|||
eq(r(frozenset([1, 2, 3, 4, 5, 6])), "frozenset([1, 2, 3, 4, 5, 6])")
|
||||
eq(r(frozenset([1, 2, 3, 4, 5, 6, 7])), "frozenset([1, 2, 3, 4, 5, 6, ...])")
|
||||
|
||||
# collections.deque after 6
|
||||
eq(r(deque([1, 2, 3, 4, 5, 6, 7])), "deque([1, 2, 3, 4, 5, 6, ...])")
|
||||
|
||||
# Dictionaries give up after 4.
|
||||
eq(r({}), "{}")
|
||||
d = {'alice': 1, 'bob': 2, 'charles': 3, 'dave': 4}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue