Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ian Kelly Newsgroups: comp.lang.python Subject: Re: Strange range Date: Fri, 1 Apr 2016 08:52:27 -0600 Lines: 16 Message-ID: References: <87y48xjwqq.fsf@elektro.pacujo.net> <1459521729.2604028.565815842.7D7557F9@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de sbiSiBFbp8ySUuo7RO9KdQRTKLWfMAXWzDnKm5++KsYg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'received:209.85.223': 0.03; 'collections': 0.09; 'dict': 0.09; 'implies': 0.09; '2016': 0.16; 'iterator': 0.16; 'objection': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'sense,': 0.16; 'statement.': 0.16; 'wrote:': 0.16; 'creates': 0.18; 'object.': 0.22; 'am,': 0.23; 'header:In-Reply-To:1': 0.24; 'sense': 0.26; 'chris': 0.26; 'fri,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'equally': 0.29; 'objects': 0.29; "we're": 0.30; 'problem': 0.33; 'usually': 0.33; 'instances': 0.33; 'list': 0.34; 'received:google.com': 0.35; 'important.': 0.35; 'something': 0.35; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'method': 0.37; 'things': 0.38; 'received:209': 0.38; 'does': 0.39; 'to:addr:python.org': 0.40; 'more': 0.63; 'else.': 0.66; 'talking': 0.67; 'applying': 0.70; 'to:name:python': 0.84; 'misleading': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=ngFPiKsbutFWOQ6PJB9qib+NqA1xR0Xbi1qKXUXPqVQ=; b=Gr7xVyznDvZcStvrMgu3s3RywvB0ItlXM9Z8DSTPHaYQPrAMUmEIrBnoKBAb09Sq+o Jr1Y7abw74jKgVGM5tFf/Pa0l97hRUgJSCtc5cnmsdWKIxtoMNa89kMOuIzWeGS9AecV P+tpZIPBEjhrgyrWsYTPETOT6S3Wh0u45RCqD2MvPBVTvYoleFUwnjODXr4FcTcvhaCN Ara655E40VoABqVP8aDvjCulO8HVC0yh08vUutkSufoPDgxKi8wW/cGHNiVTvOxOll/9 yO9vy8ne60d/E0QSUNPnnB+DLYp7wv8vk3CQbkPZiplBJhck8ACcCohuxmE5FGaB/BJA hO5A== 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:from:date :message-id:subject:to; bh=ngFPiKsbutFWOQ6PJB9qib+NqA1xR0Xbi1qKXUXPqVQ=; b=I5yyxjgUvxm65nl52n9SYZsDLrtFWqZkTEMgby3hIS7IvIKdQe9mj+x/vabgOEQ6dr ieoSN8E5xMFwUEkjYNn7NEzToAZjfY2dWeI35SqnmpkAmasoEQ6rFJ7x47nby/zL7eBQ H3OWbzAofo/M9iaQsCgmQZaKA4k0ZRZir0v0Y3PuFLJyiB4Au2baC4K4wdiD/GKN8t2R A1od4V0nfgOxHM2hloikvYNvp+CyKjbwUOLfSuXeVpf2ksYS3m/qdPqnNq3iep6RdNPY UXpRWeNJdSmxv2UNt2QLBsiMWq7O+rcDkuMZRAdYHGYqZm/tnqsHLqrsLAqlcBatD2rw 1lsg== X-Gm-Message-State: AD7BkJJGTIt5JhABOua53x2oH4gPGhKkfPn5A6bEdaKEEgTWhxWy5SCZbUHNJmC/kbD1rp/oeVbXuqtZKtD9ew== X-Received: by 10.107.11.196 with SMTP id 65mr5176182iol.111.1459522387013; Fri, 01 Apr 2016 07:53:07 -0700 (PDT) In-Reply-To: <1459521729.2604028.565815842.7D7557F9@webmail.messagingengine.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:106236 On Fri, Apr 1, 2016 at 8:42 AM, Random832 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. I think the problem with that is that it implies something about the purpose of the object. Usually when we talk about the factory pattern, we're talking about an object that creates instances of something and does nothing else. So in that sense it's misleading to refer to dict or list or even range objects as "iterator factories", because they also do a lot of other things that are equally if not more important.