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


Groups > comp.lang.python > #106354

Re: Strange range

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: Strange range
Date Sun, 3 Apr 2016 17:10:42 +1000
Lines 18
Message-ID <mailman.393.1459667451.28225.python-list@python.org> (permalink)
References <87y48xjwqq.fsf@elektro.pacujo.net> <56fe76f2$0$22141$c3e8da3$5496439d@news.astraweb.com> <ndlvrt$1hlp$1@gioia.aioe.org> <mailman.311.1459521083.28225.python-list@python.org> <87lh4xjt37.fsf@elektro.pacujo.net> <1671ea2b-09ff-4745-a6e7-d2c57864cba3@googlegroups.com> <87zitbpwpr.fsf@elektro.pacujo.net> <mailman.375.1459631138.28225.python-list@python.org> <87vb3zpu49.fsf@elektro.pacujo.net> <mailman.391.1459665795.28225.python-list@python.org> <87shz3p4a5.fsf@elektro.pacujo.net>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de w1mvuUahAzmpWaaeOrRlSwX4oEkix30wFESbLPxvDGDA==
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'cc:addr:python-list': 0.09; 'meaningful': 0.09; 'python': 0.10; '(but': 0.15; '2016': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'iterable': 0.16; 'iterator': 0.16; 'iterator.': 0.16; 'object).': 0.16; 'py3': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'uniquely': 0.16; 'xrange': 0.16; 'wrote:': 0.16; 'exists': 0.18; 'library,': 0.18; 'library': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'not,': 0.22; 'saying': 0.22; 'header :In-Reply-To:1': 0.24; "doesn't": 0.26; 'message- id:@mail.gmail.com': 0.27; 'object,': 0.27; 'innovation.': 0.29; 'another': 0.32; 'functional': 0.32; 'language.': 0.32; 'returned': 0.32; 'point': 0.33; 'received:google.com': 0.35; 'but': 0.36; 'list,': 0.36; 'received:209.85': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'received:209.85.213': 0.37; 'release': 0.37; 'seem': 0.37; 'itself': 0.38; 'no,': 0.38; 'received:209': 0.38; 'anything': 0.38; 'does': 0.39; 'chrisa': 0.84; 'conservative': 0.84; 'received:209.85.213.194': 0.84; 'reliability': 0.84; 'to:none': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc; bh=VZAhdeYbZA83aY00eaVPFp1LNEAUwcs32Mm+qWteOPI=; b=yJCEBhLYCWtBn1+hI+dhDN4NC3o9Si4RgvQ9DzWlRGCs8/Fs/ASzQbnmIODhsXwUV7 P9Cr8ClQTBwDLgTmkUh601g7QpVYnVGBjL9w2SKFSXdisM3sPeUQZRoP0nIkwoqr8IlL uH0Fx/3z89SdA51rzM7LKQHyGY7bKQkWfiWMxHw9MiT6vB1hI8sNadPAKAGT0qt0O79h fwFgZoUksQpOsSfrTWh4bLQvgSwSrPmYewr8b+lJ305qme+rgLlNfQXZXofcrTcaJ4sY luCVa13/MsJGVkaIHxxCCJLmG5vcaJKg9tidAAzVjVPu2Lv0SYInbfSeaRn/yCYVN4+y 9XUA==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc; bh=VZAhdeYbZA83aY00eaVPFp1LNEAUwcs32Mm+qWteOPI=; b=iK3q7q37kBTfD7b/+dV7Hetz9rH4EdVWPYRlKe7cRB96EaZ2CGSCcuWzvP72sxc/Fx YHYXvkH1M2sa0492j0LHgX8RvB767YXQth1m2QHWXzvAcSmIwFCXJQ6KMA8zaqPqlXtE VMiQ6blfdquuZ6BoCXEYurD2lw2QJjJPmle1Yki/2ZXRgBoI4AH2yFcZ9FQJqj347SyC QytIDQUOi4fnioHxHWpqKA2N1Nuz8RRUBhSl5he1fZF/chv2UbEOKqQharQGCqAqc+5E jsx5r2on1t/LaRmt02r6fRT5o20DnZwPS5kwjEtCfKRhvdGcAxgpo+dEpsHh5jaE0+fM EfLQ==
X-Gm-Message-State AD7BkJKC1iH19eTwLoRPxCeXuL4xJcGaNyLnIIByUovdVV7QdFQB/OZcR8Jo5EOc8612qhw3jLkounjLLqGIYw==
X-Received by 10.107.63.139 with SMTP id m133mr1531266ioa.157.1459667442796; Sun, 03 Apr 2016 00:10:42 -0700 (PDT)
In-Reply-To <87shz3p4a5.fsf@elektro.pacujo.net>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.21
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:106354

Show key headers only | View raw


On Sun, Apr 3, 2016 at 4:58 PM, Marko Rauhamaa <marko@pacujo.net> wrote:
>> That a use exists in the standard library, or that one does not,
>> doesn't really tell you anything meaningful about Python itself or
>> good practices with the language. The standard library is under
>> uniquely conservative constraints that enshrine compatibility and
>> reliability from one point release to another over any kind of
>> innovation.
>
> What you seem to be saying is that range() used to be an iterator but
> has since ascended to the status of an iterable.

No, range() has never returned an iterator. In Python 2, it returned a
list, which is iterable. In Python 3, it returns a range object, which
is iterable. And in Python 2, xrange returns an xrange object, which
is also iterable (but less functional than the Py3 range object). None
of these is an iterator.

ChrisA

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


Thread

Strange range Marko Rauhamaa <marko@pacujo.net> - 2016-04-01 16:15 +0300
  Re: Strange range Chris Angelico <rosuav@gmail.com> - 2016-04-02 00:24 +1100
  Re: Strange range Steven D'Aprano <steve@pearwood.info> - 2016-04-02 00:26 +1100
    Re: Strange range Marko Rauhamaa <marko@pacujo.net> - 2016-04-01 17:12 +0300
      Re: Strange range Random832 <random832@fastmail.com> - 2016-04-01 10:39 -0400
    Re: Strange range Fabien <fabien.maussion@gmail.com> - 2016-04-01 16:16 +0200
      Re: Strange range Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-04-01 17:28 +0300
      Re: Strange range Chris Angelico <rosuav@gmail.com> - 2016-04-02 01:31 +1100
        Re: Strange range Marko Rauhamaa <marko@pacujo.net> - 2016-04-01 17:34 +0300
          Re: Strange range Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-04-01 17:44 +0300
          Re: Strange range Chris Angelico <rosuav@gmail.com> - 2016-04-02 01:45 +1100
            Re: Strange range Marko Rauhamaa <marko@pacujo.net> - 2016-04-01 18:43 +0300
          Re: Strange range Erik <python@lucidity.plus.com> - 2016-04-01 20:58 +0100
            Re: Strange range Marko Rauhamaa <marko@pacujo.net> - 2016-04-01 23:14 +0300
              Re: Strange range Rob Gaddi <rgaddi@highlandtechnology.invalid> - 2016-04-01 20:21 +0000
                Re: Strange range Marko Rauhamaa <marko@pacujo.net> - 2016-04-01 23:44 +0300
              Re: Strange range Steven D'Aprano <steve@pearwood.info> - 2016-04-02 21:09 +1100
                Re: Strange range Marko Rauhamaa <marko@pacujo.net> - 2016-04-02 13:48 +0300
          Re: Strange range Ned Batchelder <ned@nedbatchelder.com> - 2016-04-02 12:47 -0700
            Re: Strange range Marko Rauhamaa <marko@pacujo.net> - 2016-04-02 23:44 +0300
              Re: Strange range Chris Angelico <rosuav@gmail.com> - 2016-04-03 07:05 +1000
                Re: Strange range Marko Rauhamaa <marko@pacujo.net> - 2016-04-03 00:40 +0300
                Re: Strange range Ned Batchelder <ned@nedbatchelder.com> - 2016-04-02 14:50 -0700
                Re: Strange range Stephen Hansen <me+python@ixokai.io> - 2016-04-02 23:43 -0700
                Re: Strange range Marko Rauhamaa <marko@pacujo.net> - 2016-04-03 09:58 +0300
                Re: Strange range Chris Angelico <rosuav@gmail.com> - 2016-04-03 17:10 +1000
                Re: Strange range Ethan Furman <ethan@stoneleaf.us> - 2016-04-03 09:28 -0700
                Re: Strange range Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-04-04 13:21 +0100
                Re: Strange range Chris Angelico <rosuav@gmail.com> - 2016-04-03 17:08 +1000
              Re: Strange range Steven D'Aprano <steve@pearwood.info> - 2016-04-03 14:43 +1000
                Re: Strange range Random832 <random832@fastmail.com> - 2016-04-03 01:20 -0400
                Re: Strange range Steven D'Aprano <steve@pearwood.info> - 2016-04-03 15:28 +1000
      Re: Strange range Marko Rauhamaa <marko@pacujo.net> - 2016-04-01 17:32 +0300
  Re: Strange range Random832 <random832@fastmail.com> - 2016-04-01 10:42 -0400
  Re: Strange range Chris Angelico <rosuav@gmail.com> - 2016-04-02 01:50 +1100
  Re: Strange range Ian Kelly <ian.g.kelly@gmail.com> - 2016-04-01 08:52 -0600

csiph-web