[ python-Bugs-857857 ] pprint should handle subtypes of dict/list/tuple

SourceForge.net noreply at sourceforge.net
Thu Dec 11 06:40:20 EST 2003


Bugs item #857857, was opened at 2003-12-10 22:16
Message generated for change (Comment added) made by doerwalter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=857857&group_id=5470

Category: Python Library
Group: Feature Request
>Status: Closed
>Resolution: Duplicate
Priority: 5
Submitted By: Bob Ippolito (etrepum)
Assigned to: Nobody/Anonymous (nobody)
Summary: pprint should handle subtypes of dict/list/tuple

Initial Comment:
I often implement subclasses of dict, list, tuple, etc and it's 
annoying that I can't use pprint on them.  I suggest that 
instead of using this pattern:
type(something) is dict

it should use:
type(something).__repr__ is dict.__repr__

----------------------------------------------------------------------

>Comment By: Walter Dörwald (doerwalter)
Date: 2003-12-11 12:40

Message:
Logged In: YES 
user_id=89016

This is a duplicate of http://www.python.org/sf/750542. In
Python 2.4 subclasses of dict/list/tuple will be pretty
printed as long as they don't overwrite __repr__.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=857857&group_id=5470



More information about the Python-bugs-list mailing list