Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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; 'python': 0.08; 'ah,': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'length.': 0.09; 'list)': 0.09; 'message-id:@stoneleaf.us': 0.09; 'received:gator410.hostgator.com': 0.09; 'rejected.': 0.09; 'types:': 0.09; '~ethan~': 0.09; 'wrote:': 0.15; 'bieber': 0.16; 'declaimed': 0.16; 'docs,': 0.16; 'generated,': 0.16; 'iterator,': 0.16; 'length,': 0.16; 'them.)': 0.16; 'xrange': 0.16; 'cc:addr :python-list': 0.16; 'exists.': 0.19; 'cc:2**0': 0.21; "aren't": 0.22; 'cc:no real name:2**0': 0.22; 'header:In-Reply-To:1': 0.22; 'slice': 0.23; 'index': 0.25; 'suggestion': 0.26; "i'm": 0.27; 'objects': 0.28; 'lee': 0.28; 'sat,': 0.28; 'lists': 0.29; 'cc:addr:python.org': 0.30; 'turned': 0.30; '3.x': 0.30; 'behaves': 0.30; 'confident': 0.30; 'recall': 0.30; 'subject:?': 0.31; 'values': 0.31; 'seem': 0.31; 'proposed': 0.32; "what's": 0.33; 'instead': 0.34; 'header:User-Agent:1': 0.34; 'nobody': 0.34; "can't": 0.34; 'latter': 0.35; 'subject:What': 0.35; 'pretty': 0.35; 'probably': 0.35; 'regular': 0.36; 'sequence': 0.37; 'but': 0.37; 'subject:: ': 0.38; 'returning': 0.38; 'steven': 0.38; 'something': 0.38; 'except': 0.39; 'might': 0.39; 'views': 0.40; 'did': 0.40; 'full': 0.63; 'received:websitewelcome.com': 0.65; 'received:184': 0.67; 'size.': 0.71; 'dennis': 0.77; 'else...': 0.84 Date: Sat, 30 Jul 2011 23:42:50 -0700 From: Ethan Furman User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Dennis Lee Bieber Subject: Re: What is xrange? References: <4e335ce4$0$29977$c3e8da3$5496439d@news.astraweb.com> <4e33ecc4$0$29987$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator410.hostgator.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stoneleaf.us X-BWhitelist: no X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: c-67-170-168-84.hsd1.or.comcast.net ([192.168.74.5]) [67.170.168.84]:3366 X-Source-Auth: ethan+stoneleaf.us X-Email-Count: 1 X-Source-Cap: dG9idWs7dG9idWs7Z2F0b3I0MTAuaG9zdGdhdG9yLmNvbQ== 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1312094634 news.xs4all.nl 23934 [2001:888:2000:d::a6]:49440 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:10617 Dennis Lee Bieber wrote: > On Sat, 30 Jul 2011 21:36:41 +1000, Steven D'Aprano > declaimed the following in > gmane.comp.python.general: > > >> Probably because nobody thought about it, but if it had been proposed to >> change xrange into an iterator, I'm pretty confident that the suggestion >> would have been rejected. 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, but what did they change range() into -- I seem to recall > reading the Python 3.x turned the regular range() into something else... > (from Python <3.x returning a full list) From the What's New docs, in the Views And Iterators Instead Of Lists section: range() now behaves like xrange() used to behave, except it works with values of arbitrary size. The latter no longer exists. ~Ethan~