Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Jussi Piitulainen Newsgroups: comp.lang.python Subject: Re: Strange range Date: Fri, 01 Apr 2016 17:44:42 +0300 Organization: A noiseless patient Spider Lines: 14 Message-ID: References: <87y48xjwqq.fsf@elektro.pacujo.net> <56fe76f2$0$22141$c3e8da3$5496439d@news.astraweb.com> <87lh4xjt37.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="305c68510616a2e7ac08bcd2ff1598bd"; logging-data="11268"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+698jRUUHwOy8LtIC9YdmO4bVHtiSpIew=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:Wo8nT5R98RjVskLP2F6ro7olKM8= sha1:YdcgS3dGYKXH0xx/CC3V3xLpjYs= Xref: csiph.com comp.lang.python:106233 Marko Rauhamaa writes: > Chris Angelico wrote: > >> *A range object is not an iterator.* > > We now have learned as much. > > However, doesn't that extra level of indirection seem like an odd > choice? I think it's brilliant. The range object behaves like a tuple containing the numbers in the range, one can index it, slice it, zip it, for it, like it, without it taking up the space or getting consumed in the process.