On Mon, 29 Oct 2012 11:19:38 +0000, Steven D'Aprano wrote: > Because xrange represents a concrete sequence of numbers, all three of > start, end and stride must be concrete, known, integers: > > py> xrange(4, None, 2) > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > TypeError: an integer is required > > Whereas slices can trivially include blanks that get filled in only when > actually used: > > py> "hello world"[aslice] > 'owrd' > py> "NOBODY expects the Spanish Inquisition!"[aslice] > 'D xet h pns nusto!'
/me facepalms/ Argggh, I forgot to copy-and-paste the critical line defining aslice: aslice = slice(4, None, 2) Sorry about that. -- Steven -- http://mail.python.org/mailman/listinfo/python-list