![](https://secure.gravatar.com/avatar/f3ba3ecffd20251d73749afbfa636786.jpg?s=120&d=mm&r=g)
Michael Foord wrote:
Don't we have a pretty-print API - and isn't it spelled __str__ ?
For the "reiterable" cases like dictionary views (where the object is not consumed), an appropriate __str__ or __repr__ should be written). Whether that is something as simple as "<repr of underlying dict>.items()" for an items view, or something more complicated that more directly shows the content of the view, I'm not sure. For the standard iterators like enumerate and ranged, I would suggest that they be modified to use a repr of the form: "reversed(<repr of underlying iterable>)" "enumerate(<repr of underlying iterable>)" "iter(<repr of underlying sequence>)" "iter(<repr of callable>, <repr of sentinel value>)" While those obviously won't show how much of the iterable has been consumed, neither do the current representations. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia ---------------------------------------------------------------