Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'bug': 0.02; 'fixes': 0.05; 'imply': 0.07; 'received:verizon.net': 0.07; 'python': 0.08; 'generators': 0.09; 'header:In-reply-to:1': 0.09; 'length.': 0.09; 'received:206.46': 0.09; 'received:206.46.173': 0.09; 'types:': 0.09; 'am,': 0.13; 'wrote:': 0.15; '(before': 0.16; 'ah!': 0.16; "developer's": 0.16; 'generated,': 0.16; 'generators.': 0.16; 'harsh,': 0.16; 'length,': 0.16; 'them.)': 0.16; 'x-mailer:apple mail (2.1084)': 0.16; 'xrange': 0.16; 'cc:addr:python-list': 0.16; '(which': 0.20; 'seems': 0.20; "haven't": 0.21; 'cc:2**0': 0.21; "aren't": 0.22; "doesn't": 0.22; 'trying': 0.23; 'slice': 0.23; 'index': 0.25; 'url:mailman': 0.27; 'url:edu': 0.28; 'guess': 0.28; 'objects': 0.28; "wasn't": 0.28; 'object': 0.30; 'cc:addr:python.org': 0.30; 'do.': 0.30; 'easier.': 0.30; 'thanks': 0.31; 'subject:?': 0.31; 'this.': 0.31; 'url:listinfo': 0.32; 'developers': 0.32; 'certainly': 0.32; 'too': 0.32; 'brian': 0.33; 'it.': 0.33; 'implement': 0.33; 'there': 0.34; 'realize': 0.34; "can't": 0.34; 'things': 0.34; 'clearly': 0.35; 'curious': 0.35; 'subject:What': 0.35; "isn't": 0.35; 'charset:us-ascii': 0.36; 'url:python': 0.37; 'bother': 0.37; 'sequence': 0.37; 'but': 0.37; 'getting': 0.38; 'url:org': 0.38; 'subject:: ': 0.38; 'steven': 0.38; 'something': 0.38; 'might': 0.39; 'sense': 0.40; 'huge': 0.64; 'life': 0.64; 'view': 0.67; '30,': 0.74; 'dealt': 0.91; 'received:home': 0.91 Subject: Re: What is xrange? MIME-version: 1.0 (Apple Message framework v1084) Content-type: text/plain; charset=us-ascii From: Brian Blais In-reply-to: <4e33ecc4$0$29987$c3e8da3$5496439d@news.astraweb.com> Date: Sat, 30 Jul 2011 09:46:01 -0400 Content-transfer-encoding: quoted-printable References: <4e335ce4$0$29977$c3e8da3$5496439d@news.astraweb.com> <4e33ecc4$0$29987$c3e8da3$5496439d@news.astraweb.com> To: Steven D'Aprano X-Mailer: Apple Mail (2.1084) Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 54 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1312033579 news.xs4all.nl 23847 [2001:888:2000:d::a6]:45278 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:10579 On Jul 30, 2011, at 7:36 AM, Steven D'Aprano wrote: > xrange objects might be lazily generated, but > they're also sequence types: you can get their length, and you can = index > them. (However you can't slice them.) Iterators are not sequence = types: > they aren't indexable and you can't get their length. ah! now that makes sense. I guess I never check their length, or index = them, and only use them like generators. :) thanks for the clarification! > It isn't like the Python developers are sitting around bored, looking = for > things to do. They are overworked with far too much to do and not = enough > manpower or time to do it. There are a huge number of much more = important > bug fixes and features that haven't been dealt with for them to bother = with > something like this. Now, that seems a little harsh, and nothing that I was intending. I = figured (before learning about getting its length and indexing) that if = the xrange object was basically a pre-generator hack, that it would make = sense from a code-clarity point of view to reimplement them as = generators -- it would gave made the developer's life easier. Now that = I realize that xrange has different functionality than a generator = (which was the point of my question...just curious *what* different = functionality) it clearly doesn't make sense to implement them as = generators. I certainly wasn't trying to imply that the developers are = lazy, or bored! bb >=20 >=20 >=20 > --=20 > Steven >=20 > --=20 > http://mail.python.org/mailman/listinfo/python-list --=20 Brian Blais bblais@bryant.edu http://web.bryant.edu/~bblais http://bblais.blogspot.com/