[Python-Dev] string representation of range in 3.0

Armin Rigo arigo at tunes.org
Wed Apr 16 12:15:44 CEST 2008

Hi Greg,

On Wed, Apr 16, 2008 at 03:34:44PM +1200, Greg Ewing wrote:
> > That's why I proposed <0, 1, ..., 9> for repr(range(10)).
> My worry is that this will lead a newcomer into thinking
> this is some kind of valid expression syntax.

What about the less confusing and more readily generalizable:

   <range object 0, 1, ..., 9>

It would also be helpful IMHO to use this kind of repr for most built-in
iterators and iterables, instead of their mosty-useless default repr.

A bientot,


More information about the Python-Dev mailing list