[Python-Dev] pprint(iterator)

Guido van Rossum guido at python.org
Tue Jan 27 23:42:59 CET 2009


On Tue, Jan 27, 2009 at 2:24 PM, Raymond Hettinger <python at rcn.com> wrote:
>
> [Guido van Rossum]
>>
>> My only thought is that whatever you do, target Python 3.1, not 3.0.1.
>
> Of course.
> Do you have any thoughts on the most useful display format?
> What do you want to see from pprint(mydict.items())?

Perhaps <['a', 'b', ...]> ? The list display is familiar to everyone;
the surrounding <> make it clear that it's not really a list without
adding much noise.

Another idea would be <dict_items: ['a', 'b', ...]> which helpfully
includes the name of the type of the object that was passed into
pprint().

Regarding range(), I wonder if we really need to show more than
'range(0, 10)' -- anything besides that would be wasteful IMO.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list