[issue5131] pprint doesn't know how to print a defaultdict

Terry J. Reedy report at bugs.python.org
Fri Jul 9 04:54:49 CEST 2010


Terry J. Reedy <tjreedy at udel.edu> added the comment:

I removed 'a set or' from the title since sets are no longer an issue.

Since .fromkeys is a class method, it should be called on a class rather than an instance. I was initially fooled by the irrelevant addition of '(int)'. 100 is unnecessarily large for example and review.

Patch changes code and test. However, I cannot tell what effect is has merely from reading the patch. Please add an example of the altered output, with 100 lowered to 5 or 10.

A doc change is not needed since it merely says "The pprint module provides a capability to “pretty-print” arbitrary Python data structures "

I suspect the patch needs some update to apply to for 3.2a. Has Tarek's name been fixed already?

----------
nosy: +tjreedy
stage:  -> patch review
title: pprint doesn't know how to print a set or a defaultdict -> pprint doesn't know how to print a defaultdict
versions: +Python 3.2 -Python 2.5, Python 3.1

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


More information about the Python-bugs-list mailing list