Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'static': 0.04; 'variables': 0.07; 'variables.': 0.09; 'cc:addr:python- list': 0.11; 'declared': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'globals.': 0.16; 'subject:programming': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'typing': 0.19; 'cc:addr:python.org': 0.22; 'certainly': 0.24; "shouldn't": 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'steven': 0.31; 'could': 0.34; 'except': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'two': 0.37; 'e.g.': 0.38; 'mar': 0.68; 'to:none': 0.92; 'imagine': 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=CxMgqA+oimTzRUMvE1aylHHaV6FnVwBe7Fgy+7RpcG4=; b=RjQwhCdhKtkoCdbYYyp3UiRLh4QV2iUeeuqNl9hVYomECK3K9/uhD9C+jHxx7q6s8j 7WwHgnGW/14vsjRaH0WQJi8oBJQoLS9M5hd7qHZnvHRFluVBVQ/k8PNSJ8TuwXRbkoPj kiAHGZU1sEh54c9/cpVT4vEJW2l+RRqmseX2tPq3bg/EFjdABHd/bREhOOura+58LlFC gaa1NdrbVH2i8WnS8xCr1JfUQtet5qsCtnb2HrjciStr3/kXQ79LeMF6XcopI3nQfEkk Q0qmJSf9wvM82KdS68+WNgqrOXJwq3moE4XgbnDHFiYV14YNZ9e9kDDBhLDHTr+W8XDl eHNw== MIME-Version: 1.0 X-Received: by 10.68.201.10 with SMTP id jw10mr79517pbc.25.1393946898058; Tue, 04 Mar 2014 07:28:18 -0800 (PST) In-Reply-To: <5315eec0$0$29985$c3e8da3$5496439d@news.astraweb.com> References: <4c7dbc57-eef9-4582-aecd-aac13a39b45f@googlegroups.com> <3b54a279-03a1-4a81-a428-ecad6eb16036@googlegroups.com> <216bb5f4-32c4-4f86-a9f4-1b0dd37a2a81@googlegroups.com> <0129a5b9-b85f-4ad5-b5e2-bfb2a48041d5@googlegroups.com> <5314bb96$0$29985$c3e8da3$5496439d@news.astraweb.com> <5315661c$0$2923$c3e8da3$76491128@news.astraweb.com> <53159540$0$2923$c3e8da3$76491128@news.astraweb.com> <5315eec0$0$29985$c3e8da3$5496439d@news.astraweb.com> Date: Wed, 5 Mar 2014 02:28:17 +1100 Subject: Re: Functional programming From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393946907 news.xs4all.nl 2954 [2001:888:2000:d::a6]:32882 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:67693 On Wed, Mar 5, 2014 at 2:18 AM, Steven D'Aprano wrote: > You don't need to have static typing to have declared variables. The two > are independent. E.g. one might have a system like Python, except you > have to declare your variables before using them: > > global x > local a > a = x+1 Aside: If you declare your locals, you shouldn't need to declare your globals. Though I could imagine a rule that global rebinding still needs to be declared, but you certainly shouldn't need to declare nonlocal if you have a local declaration. Absence of local => nonlocal. ChrisA