Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: [STORY-TIME] THE BDFL AND HIS PYTHON PETTING ZOO Date: Fri, 19 Feb 2016 08:54:50 +1100 Lines: 52 Message-ID: References: <48762040-a7e0-434c-92e8-8a0969210e5b@googlegroups.com> <5d31dd14-1a60-4f80-8889-d0616f404c70@googlegroups.com> <4e902c58-3370-4adf-905d-74630a6eea90@googlegroups.com> <60036746-78f7-4f05-a6d8-04e88b09c00f@googlegroups.com> <032f0f66-34df-4325-98e0-1127025d2a94@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de ZBdw1FRidMROAvMN8hMmgwgZK9NF82fOCkJgfaXTjmsA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:: [': 0.03; 'received:209.85.223': 0.03; 'friday,': 0.07; 'squares': 0.07; 'cc:addr:python-list': 0.09; 'arg': 0.09; 'func': 0.09; 'snippet': 0.09; 'python': 0.10; 'output': 0.13; 'def': 0.13; '2016': 0.16; 'confirm:': 0.16; 'evaluating': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:209.85.223.173': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:PYTHON': 0.16; 'wrote:': 0.16; 'subject:] ': 0.19; '>>>': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'am,': 0.23; 'seems': 0.23; 'feb': 0.23; 'eager': 0.23; "python's": 0.23; 'header:In-Reply- To:1': 0.24; 'fri,': 0.27; 'least': 0.27; 'message- id:@mail.gmail.com': 0.27; "i'm": 0.30; 'run': 0.33; 'received:google.com': 0.35; 'received:209.85': 0.36; 'evaluation': 0.36; 'really': 0.37; '12,': 0.37; 'thought': 0.37; 'received:209': 0.38; 'christian': 0.38; 'does': 0.39; 'subject:-': 0.39; 'rather': 0.39; 'john': 0.61; 'side': 0.62; 'skip:n 10': 0.62; '2...': 0.84; 'chrisa': 0.84; 'gollwitzer': 0.84; 'to:none': 0.91; 'effects,': 0.91; 'evaluation.': 0.91; 'lists:': 0.91; 'subject:THE': 0.91; 'rick': 0.93; 'subject:AND': 0.93 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 :content-type; bh=6Gk90laAxdbXSHJw0ahi0qsie+eQrF0Q7HUdTYA35g0=; b=ro3et+kGgy/SgUOuRhiG1KuqojnG3z/iccxKvp49qx5wqSY2bjvECCUnnXWXjxgGrj ikSYfCDB33g6uwUtYvhDsLYTZcfTy5nbhcm0hj8IksTBpn4SXixCgUuMonDg//BfLMDN 20y0dw4IDDiRItzg42pUjijBV8owmXSJZaa3zfoJCnoxQv9H07E4WQLf8FGHhfm0IONR ez/5r++Wf7LjTTPdZ7JMKXhasDPV4BHfKXHP/olJKO8MWV1R9bVpQk7nxuN+mljsYNh7 0ZvU0t4uMrRpG7xnIms59VkaktpfwwOBvH/OB8NhoheMmRflq+zBkeUa1PHfUQqORhU+ 3zsA== 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:content-type; bh=6Gk90laAxdbXSHJw0ahi0qsie+eQrF0Q7HUdTYA35g0=; b=igsRWNHECSxRP/kb62FXGCIw5NWMzUV03uG3zoJf5b+eLzj5s+4CE0eoHu4ev2UEiV 1FmKoKnoXBXMEV/Q9Dlur3NdaKgi+5jqO4btIUKX69GpZqnrKKCyqZ5SfqdoscLebZbo Nhn/bUBBtZv/FNwI4u8kn12w6yQUDxfrfU6r/d42jOdHrYhzavoRjOep3uQqW9/7UajL bvAmEVW1S6UYzw9iIrc9wXzv7AijSg8e2ddosrbiIk8goJdBOlz+Ph/JTw66ISZ0zBld Oc86lUulp+w+bLtecrn3pKt4zmTggwWLOEsgonDQ0A86VPHrdxLYoemTh2+eDK1riDD1 u5OA== X-Gm-Message-State: AG10YOTvugjjNlvygv82bJ7ihNShBvSxl3sbYyQpl30BNn5p7M2q209y8XaFm89aITcWnwL6yaPQqytGbkiwFQ== X-Received: by 10.107.14.73 with SMTP id 70mr11246392ioo.31.1455832490476; Thu, 18 Feb 2016 13:54:50 -0800 (PST) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21rc2 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:103152 On Fri, Feb 19, 2016 at 8:14 AM, Christian Gollwitzer wrote: > Am 16.02.16 um 03:02 schrieb Rick Johnson: >> >> On Friday, February 12, 2016 at 1:51:35 AM UTC-6, John Ladasky wrote: >>> >>> I like lazy evaluation. >> >> >> Well, it is a "Pythonic feature" no doubt. > > > > ?? I'm confused. Does Python have lazy evaluation? I thought that Python > does eager evaluation. At least this snippet seems to confirm: > > def arg(): > print("Evaluating arg") > return None > > def func(x): > print("Evluating func") > print(x) > > func(arg()) > > If I run it, the output is: > > Evaluating arg > Evluating func > > and I think that with side effects, only eager evaluation is really > predictable. Python's form of lazy evaluation comes in the form of functions that return iterables, rather than concrete lists: >>> def square(x): ... print("Squaring %d..." % x) ... return x*x ... >>> squares = map(square, range(10)) >>> next(squares) Squaring 0... 0 >>> next(squares) Squaring 1... 1 >>> next(squares) Squaring 2... 4 ChrisA