Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #10617

Re: What is xrange?

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 <ethan@stoneleaf.us>
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 <ethan@stoneleaf.us>
User-Agent Thunderbird 2.0.0.24 (Windows/20100228)
MIME-Version 1.0
To Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject Re: What is xrange?
References <j0v23e$g6o$1@speranza.aioe.org> <4e335ce4$0$29977$c3e8da3$5496439d@news.astraweb.com> <mailman.1654.1312025049.1164.python-list@python.org> <4e33ecc4$0$29987$c3e8da3$5496439d@news.astraweb.com> <j126a1$v8o$1@dough.gmane.org>
In-Reply-To <j126a1$v8o$1@dough.gmane.org>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1688.1312094634.1164.python-list@python.org> (permalink)
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

Show key headers only | View raw


Dennis Lee Bieber wrote:
> On Sat, 30 Jul 2011 21:36:41 +1000, Steven D'Aprano
> <steve+comp.lang.python@pearwood.info> 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~

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

What is xrange? Billy Mays <noway@nohow.com> - 2011-07-29 15:36 -0400
  Re: What is xrange? harrismh777 <harmar@member.fsf.org> - 2011-07-29 14:47 -0500
  Re: What is xrange? Thomas Jollans <t@jollybox.de> - 2011-07-29 22:31 +0200
  Re: What is xrange? Jerry Hill <malaclypse2@gmail.com> - 2011-07-29 16:36 -0400
  Re: What is xrange? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-30 11:22 +1000
    Re: What is xrange? Brian Blais <bblais@bryant.edu> - 2011-07-30 06:23 -0400
      Re: What is xrange? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-30 21:36 +1000
        Re: What is xrange? Brian Blais <bblais@bryant.edu> - 2011-07-30 09:46 -0400
        Re: What is xrange? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-07-30 17:06 -0700
        Re: What is xrange? Chris Angelico <rosuav@gmail.com> - 2011-07-31 01:10 +0100
        Re: What is xrange? Ethan Furman <ethan@stoneleaf.us> - 2011-07-30 23:42 -0700
      Re: What is xrange? Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-07-31 12:18 +1200

csiph-web