mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
This commit is contained in:
parent
b4bbee25b1
commit
d6da90f93d
3 changed files with 17 additions and 1 deletions
|
@ -462,6 +462,15 @@ class QueryTestCase(unittest.TestCase):
|
|||
self.assertEqual(clean(pprint.pformat(dict.fromkeys(keys))),
|
||||
'{' + ','.join('%r:None' % k for k in skeys) + '}')
|
||||
|
||||
# Issue 10017: TypeError on user-defined types as dict keys.
|
||||
self.assertEqual(pprint.pformat({Unorderable: 0, 1: 0}),
|
||||
'{1: 0, ' + repr(Unorderable) +': 0}')
|
||||
|
||||
# Issue 14998: TypeError on tuples with NoneTypes as dict keys.
|
||||
self.assertEqual(pprint.pformat({(1,): 0, (None,): 0}),
|
||||
'{(1,): 0, (None,): 0}')
|
||||
|
||||
|
||||
class DottedPrettyPrinter(pprint.PrettyPrinter):
|
||||
|
||||
def format(self, object, context, maxlevels, level):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue