Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #49473
| Path | csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.023 |
| X-Spam-Evidence | '*H*': 0.95; '*S*': 0.00; 'parameters': 0.04; 'class,': 0.07; 'explicit': 0.07; 'consistency': 0.09; 'instance.': 0.09; 'python': 0.11; 'bind': 0.16; 'declaration': 0.16; 'declarations': 0.16; 'definition.': 0.16; 'differs': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'local.': 0.16; 'reedy': 0.16; 'unbound': 0.16; 'sat,': 0.16; 'fix': 0.17; 'wrote:': 0.18; '>>>': 0.22; 'code,': 0.22; 'errors.': 0.24; 'passes': 0.24; 'switched': 0.24; 'possibly': 0.26; 'required.': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'needed.': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'boundary': 0.31; 'implicit': 0.31; 'another': 0.32; 'beginning': 0.33; 'definition': 0.35; 'one,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'consistent': 0.36; 'subject:?': 0.36; 'should': 0.36; 'two': 0.37; 'mine': 0.38; 'others.': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'that,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'either': 0.39; 'skip:u 10': 0.60; 'catch': 0.60; 'ian': 0.60; 'new': 0.61; 'matter': 0.61; 'strictly': 0.61; 'simply': 0.61; 'first': 0.61; 'name': 0.63; 'different': 0.65; '30,': 0.65; 'kept': 0.65; 'ever.': 0.84; 'hardly': 0.84; 'magical': 0.91; 'yours.': 0.93; '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=jzzG+0nUKWExTkAVXRQbbQ95Q1s2zSFOk9kF2q+qKPg=; b=XaeXUUePRnwJko+Ki3jdG4P1hC2pTGmVRr/3kmMTdECGa4UbmHUn44fHAQQm9LFakS WFMqFsv0mahTN8sHuWzVkqAcdyljIuagQMOtL0JvRw+PRtiarmipWWTssVtL5qjlgXth y6vWWC21icTF5MwFuJ6b/kzhKV/aTmHHWudmsg9zGJ8/0HhNtuuVB3AKb/N/i4PL8mpa mh0KE4ql0L/SRVO56cuMxOQsFj3sRzUBlTJ1x3SRAOLVEjSfC7b9uMAodWOOWUsqvfRC 1zbzOAlUgTyiiAE2V9xukevKs96X2kUqyU95NhBY7KJY30TqmYjQRRhkBf9YwbV+3mNV JKdA== |
| MIME-Version | 1.0 |
| X-Received | by 10.220.182.193 with SMTP id cd1mr7903980vcb.32.1372568882070; Sat, 29 Jun 2013 22:08:02 -0700 (PDT) |
| In-Reply-To | <kqocdd$n7u$1@ger.gmane.org> |
| References | <2a2072e3-4b12-4ada-872c-1240d2379928@googlegroups.com> <mailman.3984.1372500107.3114.python-list@python.org> <bc798729-f935-448d-9d62-c409b2d12e76@googlegroups.com> <51cf2b49$0$29999$c3e8da3$5496439d@news.astraweb.com> <2f5e7801-a4cd-4d01-a1e7-7f67bca18199@googlegroups.com> <51cf3695$0$29999$c3e8da3$5496439d@news.astraweb.com> <CALwzidm4YBa_DgTUTKAxnnirg1Uxuyds8kWf=urh+rQd=ct5Hg@mail.gmail.com> <kqnhgf$2fe$1@ger.gmane.org> <CALwzidk+0H+5pi_Wx4ymBFDuZ4UKt1O-3FY5p2UfuDPpf=nXcg@mail.gmail.com> <kqocdd$n7u$1@ger.gmane.org> |
| Date | Sun, 30 Jun 2013 15:08:01 +1000 |
| Subject | Re: Closures in leu of pointers? |
| From | Chris Angelico <rosuav@gmail.com> |
| 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 <python-list.python.org> |
| List-Unsubscribe | <http://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 | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.4018.1372568890.3114.python-list@python.org> (permalink) |
| Lines | 36 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1372568890 news.xs4all.nl 15980 [2001:888:2000:d::a6]:48063 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:49473 |
Show key headers only | View raw
On Sun, Jun 30, 2013 at 2:32 PM, Terry Reedy <tjreedy@udel.edu> wrote: > On 6/29/2013 5:21 PM, Ian Kelly wrote: >> >> On Sat, Jun 29, 2013 at 2:53 PM, Terry Reedy <tjreedy@udel.edu> wrote: >>> >>> # The alternative for either program or people is a 1-pass + backtracking >>> process where all understandings are kept provisional until the end of >>> the >>> body and revised as required. 2 passes are simpler. >> >> >> Or simply an explicit declaration of scope at the beginning of the >> function definition. > > > One of the reasons I switched to Python was to not have to do that, or > hardly ever. For valid code, an new declaration is hardly needed. Parameters > are locals. If the first use of another name binds it (and that includes > import, class, and def), it is local. If the first use of does not bind it, > it had better not be local (because if it is, there well be an exception). > If there are branches, each should be consistent with the others. One should > only need two readings to understand and fix unbound local errors. This is strictly a matter of opinion, and one on which mine differs from yours. I think explicit declarations are better than implicit "you've assigned to this name" local creations; the declarations help to catch typos. Also, I like the consistency of C-style declarations - where-ever you declare something, it's valid from there "in", and not "out". Without declarations, there's a magical scope boundary at a function definition that's different from the non-boundary at a loop, for instance. But that's just my opinion. and as Teresa says, I'm only one, and possibly I'm wrong. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Closures in leu of pointers? cts.private.yahoo@gmail.com - 2013-06-29 02:34 -0700
Re: Closures in leu of pointers? Fábio Santos <fabiosantosart@gmail.com> - 2013-06-29 10:42 +0100
Re: Closures in leu of pointers? Peter Otten <__peter__@web.de> - 2013-06-29 12:01 +0200
Re: Closures in leu of pointers? cts.private.yahoo@gmail.com - 2013-06-29 04:21 -0700
Re: Closures in leu of pointers? cts.private.yahoo@gmail.com - 2013-06-29 04:44 -0700
Re: Closures in leu of pointers? Peter Otten <__peter__@web.de> - 2013-06-29 14:12 +0200
Re: Closures in leu of pointers? cts.private.yahoo@gmail.com - 2013-06-29 05:26 -0700
Re: Closures in leu of pointers? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-06-29 15:37 +0100
Re: Closures in leu of pointers? cts.private.yahoo@gmail.com - 2013-06-29 07:48 -0700
Re: Closures in leu of pointers? Michael Torrie <torriem@gmail.com> - 2013-06-29 07:56 -0600
Re: Closures in leu of pointers? Michael Torrie <torriem@gmail.com> - 2013-06-29 12:36 -0600
Re: Closures in leu of pointers? Michael Torrie <torriem@gmail.com> - 2013-06-29 08:02 -0600
Re: Closures in leu of pointers? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-06-29 19:02 +0200
Re: Closures in leu of pointers? rusi <rustompmody@gmail.com> - 2013-06-29 10:33 -0700
Re: Closures in leu of pointers? cts.private.yahoo@gmail.com - 2013-06-29 11:37 -0700
Re: Closures in leu of pointers? Michael Torrie <torriem@gmail.com> - 2013-06-29 12:58 -0600
Re: Closures in leu of pointers? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-29 18:59 +0000
Re: Closures in leu of pointers? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-29 18:51 +0000
Re: Closures in leu of pointers? Michael Torrie <torriem@gmail.com> - 2013-06-29 13:04 -0600
Re: Closures in leu of pointers? rusi <rustompmody@gmail.com> - 2013-06-29 12:11 -0700
Re: Closures in leu of pointers? Michael Torrie <torriem@gmail.com> - 2013-06-29 12:35 -0600
Re: Closures in leu of pointers? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-29 19:19 +0000
Re: Closures in leu of pointers? Tim Chase <tim@thechases.com> - 2013-06-29 14:42 -0500
Re: Closures in leu of pointers? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-30 01:41 +0000
Re: Closures in leu of pointers? Joshua Landau <joshua.landau.ws@gmail.com> - 2013-06-29 21:02 +0100
Re: Closures in leu of pointers? Michael Torrie <torriem@gmail.com> - 2013-06-29 16:02 -0600
Re: Closures in leu of pointers? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-29 18:45 +0000
Re: Closures in leu of pointers? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-29 19:00 +0000
Re: Closures in leu of pointers? cts.private.yahoo@gmail.com - 2013-06-29 12:20 -0700
Re: Closures in leu of pointers? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-29 19:33 +0000
Re: Closures in leu of pointers? cts.private.yahoo@gmail.com - 2013-06-29 12:34 -0700
Re: Closures in leu of pointers? Ian Kelly <ian.g.kelly@gmail.com> - 2013-06-29 13:47 -0600
Re: Closures in leu of pointers? Terry Reedy <tjreedy@udel.edu> - 2013-06-29 16:53 -0400
Re: Closures in leu of pointers? rusi <rustompmody@gmail.com> - 2013-06-30 01:56 -0700
Re: Closures in leu of pointers? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-30 11:22 +0000
Re: Closures in leu of pointers? rusi <rustompmody@gmail.com> - 2013-06-30 04:42 -0700
Re: Closures in leu of pointers? Ian Kelly <ian.g.kelly@gmail.com> - 2013-06-29 15:21 -0600
Re: Closures in leu of pointers? cts.private.yahoo@gmail.com - 2013-06-29 14:30 -0700
Re: Closures in leu of pointers? Terry Reedy <tjreedy@udel.edu> - 2013-06-30 00:32 -0400
Re: Closures in leu of pointers? Chris Angelico <rosuav@gmail.com> - 2013-06-30 15:08 +1000
Re: Closures in leu of pointers? rusi <rustompmody@gmail.com> - 2013-06-30 00:36 -0700
Re: Closures in leu of pointers? Ian Kelly <ian.g.kelly@gmail.com> - 2013-06-29 23:46 -0600
Re: Closures in leu of pointers? alex23 <wuwei23@gmail.com> - 2013-07-01 14:57 +1000
Re: Closures in leu of pointers? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-07-01 07:36 +0000
Re: Closures in leu of pointers? Chris Angelico <rosuav@gmail.com> - 2013-06-30 15:59 +1000
Re: Closures in leu of pointers? Terry Reedy <tjreedy@udel.edu> - 2013-06-30 02:11 -0400
Re: Closures in leu of pointers? Ian Kelly <ian.g.kelly@gmail.com> - 2013-06-30 00:24 -0600
Re: Closures in leu of pointers? Michael Torrie <torriem@gmail.com> - 2013-06-29 16:03 -0600
Re: Closures in leu of pointers? Ian Kelly <ian.g.kelly@gmail.com> - 2013-06-29 13:23 -0600
Re: Closures in leu of pointers? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-06-30 12:07 +0200
Re: Closures in leu of pointers? Ian Kelly <ian.g.kelly@gmail.com> - 2013-06-30 11:13 -0600
Re: Closures in leu of pointers? Ian Kelly <ian.g.kelly@gmail.com> - 2013-06-30 11:18 -0600
csiph-web