On 3/15/2012 12:47, Chris Angelico wrote:
On Thu, Mar 15, 2012 at 10:27 PM, Kiuhnm
Your first example suggests that range(n) is a sequence iterator which
returns, if queried n times,
  0,...,n-1
(which is a bit counterintuitive, IMHO).

It's a little odd, perhaps, if seen in a vacuum. But everything counts
from zero - list indices, etc - so it makes sense for range(len(lst))
to return indices valid for lst.

Maybe range uses [...) intervals? So range(a,b) is a,a+1,a+2,...,b-1 and
range(b) is just short-hand for range(0,b)?

List comps are pretty readable if you know how programming languages
work. Python need not be readable by everyone and his grandmother, and
it does a fairly good job of being grokkable to someone who has a few
ranks in Coding. (Yeah, I'm a D&D nerd. )

I like what I've seen so far.

Kiuhnm
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to