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


Groups > comp.lang.python > #106235

Re: Strange range

From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: Strange range
Date 2016-04-02 01:50 +1100
Message-ID <mailman.315.1459522215.28225.python-list@python.org> (permalink)
References <87y48xjwqq.fsf@elektro.pacujo.net> <CAPTjJmp0a-wa=sZ0eJbcfYdNJaw=0kSrMXu5msGxNTjguoLqFw@mail.gmail.com> <1459521729.2604028.565815842.7D7557F9@webmail.messagingengine.com>

Show all headers | View raw


On Sat, Apr 2, 2016 at 1:42 AM, Random832 <random832@fastmail.com> wrote:
> On Fri, Apr 1, 2016, at 09:24, Chris Angelico wrote:
>> It is an iterable. It is not a factory, as that implies that you call
>> it.
>
> I do have an objection to this statement. It's perfectly reasonable to
> describe the factory pattern as applying to objects on which you call a
> method to return the new object you are interested in. In this sense,
> all collections are iterator factories.

Hmm. I suppose that would be reasonable, if you expect to call
range_object.__iter__() - but you shouldn't. You should call
iter(range_object), which, to my mind, means that *iter* is an
iterator factory.

Anyway, the word "iterable" accurately sums up the state: it's a thing
you can iterate over.

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