On Apr 16, 2008, at 5:15 AM, Armin Rigo wrote: > 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. >
I think this is a great compromise. It is much more helpful to the beginner than range(0,10). This would also be a very simple change to the patch I already made :-) I think it works nicely for the dict_keys, dict_values, and dict_items objects also as the student will see: <dict_items object ('a', 1), ('b', 2), ... > This reinforces that they will be iterating over tuples, which is much more helpful than a hexadecimal address. Since ordering is not important for dictionary objects I wonder whether the ending value(s) are even needed or whether the first two are enough to help the student get an idea of what the object contains. Brad > > A bientot, > > Armin. > _______________________________________________ > Python-Dev mailing list > Python-Dev@python.org > http://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > http://mail.python.org/mailman/options/python-dev/bonelake%40gmail.com _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com