On Fri, Apr 1, 2016, at 10:12, Marko Rauhamaa wrote: > Yes, I realize it now. I had thought it was: > > def range(start, end=None, step=1): > if end is None: > start, end = 0, start > i = start > while step * (end - i) > 0: > yield i > i += step
You know the other funny thing? Even people who understand this about Python 3 ranges, many assume that python 2 xrange was more similar to your latter example (possibly caused by the fact that python 2 had other things such as dict.iteritems which _were_ mere iterators) -- https://mail.python.org/mailman/listinfo/python-list