[New-bugs-announce] [issue7434] pprint doesn't know how to print a namedtuple

Anthony Foglia report at bugs.python.org
Fri Dec 4 17:32:43 CET 2009


New submission from Anthony Foglia <afoglia at gmail.com>:

It would be nice if pprint could format namedtuples wrapping lines as it
does with tuples.

Looking at the code, this does not look like an easy task.  Completely
rewriting pprint to allow it to be extensible to user-created classes
would be best, but involve a ton of work.  Simple making all named
tuples derive from a named tuple base class (itself derived from tuple)
would be simpler, albeit more of a hack.

----------
components: Library (Lib)
messages: 95968
nosy: afoglia
severity: normal
status: open
title: pprint doesn't know how to print a namedtuple
type: feature request
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7434>
_______________________________________


More information about the New-bugs-announce mailing list