Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #80470
| Path | csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <joel.goldstick@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.016 |
| X-Spam-Evidence | '*H*': 0.97; '*S*': 0.00; 'assignment': 0.07; 'function,': 0.09; 'will,': 0.09; 'subject:question': 0.10; 'cc:addr:python-list': 0.11; '"global"': 0.16; 'exist.': 0.16; 'globals.': 0.16; 'increment': 0.16; 'local.': 0.16; 'scope.': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'cc:addr:python.org': 0.22; 'mon,': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; "doesn't": 0.30; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'url:mailman': 0.30; 'url:python': 0.33; 'problem': 0.35; "can't": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'false': 0.36; 'url:listinfo': 0.36; 'thanks': 0.36; 'url:org': 0.36; 'clear': 0.37; 'nov': 0.38; 'issue': 0.38; 'url:mail': 0.40; 'read': 0.60; 'analysis,': 0.60; 'name': 0.63; 'sharing': 0.69; 'joel': 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=Qe+aNL/HNYoDW8kX9QDBcosl2+JtUTQGKX/xb8tAa9M=; b=fVGrd1otExt6tFJkey7XRfJOdWQ8L6ACXOQsQzk7I1w1fOMLimLGCU0hSkI5VDWzDs prGEpTG2ChP9SEmIFjRcgDUwXYbuF0KNN09w5kwEtOoQ/LiLDlcXZCdKRqVhlg3YYFrK TBHQoaOriymJjVM3UYcLEU1gvawR98obXM4YkCXTwHjUuxri0cRyTfACq89vBWHL368n ghDBaPvd3LpY2OHw0kdEwzN87c7iPYT6OmCxtMJ6LOK6JzdEFUHQQgLSAZ2ck08vU8ou 0cQF1YSQiQusyUqiOs6MOBK0l3ZHCG6WIkKeJdGAI4bMZiWX8rDa7lSypy4QJX+TX9Di w1tQ== |
| MIME-Version | 1.0 |
| X-Received | by 10.224.76.3 with SMTP id a3mr45224014qak.31.1415633249954; Mon, 10 Nov 2014 07:27:29 -0800 (PST) |
| In-Reply-To | <CAPTjJmpkWMjGBs1RgSpkMZnATfkLz20OG+hEQBkTuyn_dueFFA@mail.gmail.com> |
| References | <m3q6ae$m8p$1@news.albasani.net> <m3q84d$6is$1@ger.gmane.org> <CAPM-O+zDYxr-EVJtiC92R-VfGvr33ByZ1jkVdkEPdgbv0CVdog@mail.gmail.com> <CAPTjJmpkWMjGBs1RgSpkMZnATfkLz20OG+hEQBkTuyn_dueFFA@mail.gmail.com> |
| Date | Mon, 10 Nov 2014 10:27:29 -0500 |
| Subject | Re: A syntax question |
| From | Joel Goldstick <joel.goldstick@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.15626.1415633253.18130.python-list@python.org> (permalink) |
| Lines | 25 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1415633253 news.xs4all.nl 2947 [2001:888:2000:d::a6]:45876 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:80470 |
Show key headers only | View raw
On Mon, Nov 10, 2014 at 9:54 AM, Chris Angelico <rosuav@gmail.com> wrote: > On Tue, Nov 11, 2014 at 1:35 AM, Joel Goldstick > <joel.goldstick@gmail.com> wrote: >> Your problem is that count is not local. You are reading count from >> an outer scope. When you try to increment count in your function, it >> can't because it doesn't exist. >> Don't use globals. > > False analysis, I'm afraid. The problem is that the assignment will, > in the absence of a "global" declaration, cause the name "count" to > indicate a local variable - so it won't ever be read from outer scope. > However, the OP's issue is better solved by sharing tracebacks than by > us peering into crystal balls; mine's showing a very clear image at > the moment, but it might well be incorrect. > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list Interesting. Thanks for pointing that out -- Joel Goldstick http://joelgoldstick.com
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
A syntax question Mok-Kong Shen <mok-kong.shen@t-online.de> - 2014-11-10 12:07 +0100
Re: A syntax question alister <alister.nospam.ware@ntlworld.com> - 2014-11-10 11:23 +0000
Re: A syntax question David Palao <dpalao.python@gmail.com> - 2014-11-10 12:31 +0100
Re: A syntax question Grant Edwards <invalid@invalid.invalid> - 2014-11-10 14:44 +0000
Re: A syntax question alister <alister.nospam.ware@ntlworld.com> - 2014-11-10 14:54 +0000
Re: A syntax question alister <alister.nospam.ware@ntlworld.com> - 2014-11-10 14:56 +0000
Re: A syntax question Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-11-10 19:53 -0500
Re: A syntax question alister <alister.nospam.ware@ntlworld.com> - 2014-11-11 09:04 +0000
Re: A syntax question Grant Edwards <invalid@invalid.invalid> - 2014-11-10 16:11 +0000
Re: A syntax question Chris Angelico <rosuav@gmail.com> - 2014-11-11 03:18 +1100
Re: A syntax question Roy Smith <roy@panix.com> - 2014-11-10 14:48 -0500
Re: A syntax question Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-11-10 20:08 +0000
Re: A syntax question Tim Chase <python.list@tim.thechases.com> - 2014-11-10 14:29 -0600
Re: A syntax question Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2014-11-10 12:39 +0100
Re: A syntax question Joel Goldstick <joel.goldstick@gmail.com> - 2014-11-10 09:35 -0500
Re: A syntax question Chris Angelico <rosuav@gmail.com> - 2014-11-11 01:54 +1100
Re: A syntax question Peter Otten <__peter__@web.de> - 2014-11-10 16:10 +0100
Re: A syntax question Joel Goldstick <joel.goldstick@gmail.com> - 2014-11-10 10:27 -0500
csiph-web