Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #81964
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!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.006 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'python,': 0.02; 'assignment': 0.07; 'compiler': 0.07; 'cc:addr:python-list': 0.11; 'python': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'globals.': 0.16; 'wrote:': 0.18; 'normally': 0.19; 'otherwise,': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'somewhere': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; "doesn't": 0.30; 'dec': 0.30; 'statement': 0.30; 'message-id:@mail.gmail.com': 0.30; 'occurs': 0.31; 'subject:About': 0.31; 'yes.': 0.31; 'figure': 0.32; 'fri,': 0.33; 'not.': 0.33; 'but': 0.35; 'received:google.com': 0.35; 'dave': 0.60; 'strictly': 0.61; 'angel': 0.91; 'to:none': 0.92 |
| 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=n6sH1Q358XucbIQULa+cTqdp9bZidasg4W3xn4JIu8Q=; b=zYEH1L7KcX8WIarp49jfA2hczL4AdCTc6S/PByvgVBurtrQj6Qnm5QWUQjKFlCbCRi 8QnKAcut8QleKgEK0q+9Y5/9RBwj9K2oF02VB8lTEJpnaxgIsyK3MtcF8CZKiH/1K3ff tUp2LnCaesVJ/ptirvWVVyVF/swfX75ZlY2WjYJ+tOdqsVKIkQ2TRsJ5J44RpbpYjOrU ACW9Dl2SwLB0RAPfeUX6gVGthKwJnztZx38mva0+zF2fuYDy54XPvryYjq8tGCzopzj7 w1aoHies4c1N7DKfBgOGHc0JcjwAZgh0ITNHaW3+e4IfjU3sMIcsRHEI+jH4me4Vywjb WRFg== |
| MIME-Version | 1.0 |
| X-Received | by 10.50.23.48 with SMTP id j16mr829509igf.34.1417737493914; Thu, 04 Dec 2014 15:58:13 -0800 (PST) |
| In-Reply-To | <5480F432.4090803@davea.name> |
| References | <aa74bd64-0e11-492d-ae2a-4b032a0408f9@googlegroups.com> <5480F432.4090803@davea.name> |
| Date | Fri, 5 Dec 2014 10:58:13 +1100 |
| Subject | Re: About Modifying Globals |
| From | Chris Angelico <rosuav@gmail.com> |
| Cc | "python-list@python.org" <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 <python-list.python.org> |
| List-Unsubscribe | <https://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 | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.16601.1417737496.18130.python-list@python.org> (permalink) |
| Lines | 13 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1417737496 news.xs4all.nl 2911 [2001:888:2000:d::a6]:44981 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:81964 |
Show key headers only | View raw
On Fri, Dec 5, 2014 at 10:54 AM, Dave Angel <davea@davea.name> wrote: > Python doesn't have declarations, so when a function is compiled, the > compiler has to infer what names are to be local and what are not. The rule > it normally uses is roughly based on whether an assignment occurs somewhere > inside the function. Not strictly true; Python just inverts the C model. In C, you declare your locals; in Python, you declare your globals. The "global x" statement is a declaration. But otherwise, yes. When a function is compiled, the compiler has to figure out what's local and what's global. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
About Modifying Globals LJ <luisjosenovoa@gmail.com> - 2014-12-04 12:09 -0800
Re: About Modifying Globals Chris Angelico <rosuav@gmail.com> - 2014-12-05 07:22 +1100
Re: About Modifying Globals Ian Kelly <ian.g.kelly@gmail.com> - 2014-12-04 13:21 -0700
Re: About Modifying Globals Dave Angel <davea@davea.name> - 2014-12-04 18:54 -0500
Re: About Modifying Globals Chris Angelico <rosuav@gmail.com> - 2014-12-05 10:58 +1100
Re: About Modifying Globals Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-12-05 13:09 +1100
The binding operator, and what gets bound to what (was: About Modifying Globals) Ben Finney <ben+python@benfinney.id.au> - 2014-12-05 16:36 +1100
Re: The binding operator, and what gets bound to what (was: About Modifying Globals) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-12-05 20:53 +1100
Re: The binding operator, and what gets bound to what (was: About Modifying Globals) Chris Angelico <rosuav@gmail.com> - 2014-12-05 21:03 +1100
Re: The binding operator, and what gets bound to what (was: About Modifying Globals) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-12-05 23:26 +1100
Re: The binding operator, and what gets bound to what (was: About Modifying Globals) Chris Angelico <rosuav@gmail.com> - 2014-12-05 23:42 +1100
Re: The binding operator, and what gets bound to what Ned Batchelder <ned@nedbatchelder.com> - 2014-12-05 07:06 -0500
Re: The binding operator, and what gets bound to what Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-12-05 23:34 +1100
Re: The binding operator, and what gets bound to what Chris Angelico <rosuav@gmail.com> - 2014-12-05 23:48 +1100
Re: The binding operator, and what gets bound to what Ned Batchelder <ned@nedbatchelder.com> - 2014-12-05 07:56 -0500
Re: About Modifying Globals "shiyao.ma" <i@introo.me> - 2014-12-05 10:53 +0800
csiph-web