[Python-Dev] Lukewarm about range literals (original) (raw)

Greg Wilson gvwilson@nevex.com
Mon, 28 Aug 2000 18:04:41 -0400 (EDT)


Thomas Wouters wrote: They are perfectly possible (in fact, more easily so than the current solution, if it hadn't already been written.) I like the elipsis syntax myself, but mostly because i have no use for elipses, currently. It's also reminiscent of the range-creating '..' syntax I learned in MOO, a long time ago ;)

I would vote -1 on [0...100:10] --- even range(0, 100, 10) reads better, IMHO. I understand Guido et al's objections to:

for i in [:100]:

but in my experience, students coming to Python from other languages seem to expect to be able to say "do this N times" very simply. Even:

for i in range(100):

raises eyebrows. I know it's all syntactic sugar, but it comes up in the first hour of every course I've taught...

Thanks,

Greg