[New-bugs-announce] [issue45959] Teach pprint about dict views

Raymond Hettinger report at bugs.python.org
Thu Dec 2 02:06:56 EST 2021


New submission from Raymond Hettinger <raymond.hettinger at gmail.com>:

The pprint() code has a number of type or protocol specific handlers but doesn't have one for dict views.  So, we don't get pretty printing for the key(), values(), and items():

d = {i:i for i in range(100)}
pprint(d)             # This is handled correctly
pprint(d.keys())      # Printed on one line
pprint(d.values())    # Printed on one line
pprint(d.items())     # Printed on one line

----------
components: Library (Lib)
keywords: easy
messages: 407513
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Teach pprint about dict views
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45959>
_______________________________________


More information about the New-bugs-announce mailing list