Path: csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'nasty': 0.07; 'function,': 0.09; 'parsing': 0.09; 'def': 0.12; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'func': 0.16; 'lambda': 0.16; 'subject:non': 0.16; 'wrote:': 0.18; 'later': 0.20; 'code,': 0.22; 'aug': 0.22; 'instead.': 0.24; 'string,': 0.24; 'mon,': 0.24; 'url:edu': 0.26; 'header:In-Reply-To:1': 0.27; 'specifically': 0.29; '[1]': 0.29; 'message-id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'int,': 0.31; 'steven': 0.31; 'update.': 0.31; 'trouble': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'subject:skip:d 10': 0.36; 'that!': 0.36; 'subject:?': 0.36; 'thank': 0.38; 'to:addr:python-list': 0.38; 'list,': 0.38; 'pm,': 0.38; 'little': 0.38; 'to:addr:python.org': 0.39; 'horrible': 0.84; '2013': 0.98 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:to :content-type; bh=ADWEmAoVc0Z8Y71yRcay4LutlPSiC/RuVvOXzky9mMU=; b=0mrldw9/J2QqV+IEfbS66CkNDVbbvoYwYHfl0wwVxECWm//OOihgk6m+wjf+u4ooSo Fe2xbfKTwuawX7Q5LsMuustrO+WBinCxpaQLM3ppekw5mpa7BKhztJEaLPQWMl0HNL4K caRpktnGfpx63KsA1eDPNoLt0Vd5AHEpc3rjp7J/QimMxAWmYWZkvP7KEh1ddH9LQD6y q17M1rw2Hq7QcyB8yQH+9fzx/lxahKs50LcKRVcb1IV2Kv5crA3bL5PN0KCKYv15nW29 Alo3/qjR6jC+5AYIPEPF4ZYJQW8r3H6SFspSnq7qNMP1wEX85c0A+vqG8DdP6cLdzUHO /t6w== MIME-Version: 1.0 X-Received: by 10.220.186.202 with SMTP id ct10mr9501515vcb.14.1376933117288; Mon, 19 Aug 2013 10:25:17 -0700 (PDT) In-Reply-To: <521252f2$0$29986$c3e8da3$5496439d@news.astraweb.com> References: <520f9054$0$30000$c3e8da3$5496439d@news.astraweb.com> <5211C5BD.5040209@rece.vub.ac.be> <52124e81$0$29986$c3e8da3$5496439d@news.astraweb.com> <521252f2$0$29986$c3e8da3$5496439d@news.astraweb.com> Date: Mon, 19 Aug 2013 18:25:17 +0100 Subject: Re: Importing variables non-deterministic? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1376933125 news.xs4all.nl 15938 [2001:888:2000:d::a6]:44592 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:52700 On Mon, Aug 19, 2013 at 6:16 PM, Steven D'Aprano wrote: > On Mon, 19 Aug 2013 16:57:37 +0000, Steven D'Aprano wrote: > >> def func(x): >> ... >> >> # later >> save_func = func >> func = lambda x, y: do_stuff(x, 3*y)-4 result = >> something_that_calls_func() >> func = save_func >> >> >> Nasty, horrible code, yes? But it's nasty and horrible because "func" is >> bound to a function, it would be equally nasty and horrible if it was a >> data type (a string, a list, an int, a flag, ...) instead. > > Oops, I left out a word. It is NOT nasty and horrible specifically > because "func" is bound to a function, it would be equally horrible if it > were a data type. I was having a little trouble parsing that! Thank you for the Iolanthe-style[1] update. ChrisA [1] http://math.boisestate.edu/gas/iolanthe/web_op/iol23d.html