Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Line Printer paper is strongest at the perforations.


devel / comp.lang.python / Re: Variable scope inside and outside functions - global statement being overridden by assignation unless preceded by reference

SubjectAuthor
o Re: Variable scope inside and outside functions - global statement being overridGrant Edwards

1
Re: Variable scope inside and outside functions - global statement being overridden by assignation unless preceded by reference

<mailman.63.1709905766.3452.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=29615&group=comp.lang.python#29615

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: grant.b.edwards@gmail.com (Grant Edwards)
Newsgroups: comp.lang.python
Subject: Re: Variable scope inside and outside functions - global statement
being overridden by assignation unless preceded by reference
Date: Fri, 8 Mar 2024 08:49:24 -0500 (EST)
Lines: 16
Message-ID: <mailman.63.1709905766.3452.python-list@python.org>
References: <bd2e0672-fc3e-4678-b212-04ab1f45c52c@gmail.com>
<ZepEKCbZNelFasml@cskk.homeip.net>
<4Trnb856LRznVF4@mail.python.org>
X-Trace: news.uni-berlin.de MMKKKtvJ2Fw0/Nq530Amkg65pCO4yQ5EYOrLDus8xshw==
Cancel-Lock: sha1:i02KHbOHb+Y3Q7tHMJxj0yzdpMc= sha256:pPAit/Siiit6iVc7n0zwb9xrqco5J17JDUs2NBK/AAo=
Return-Path: <grant.b.edwards@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.013
X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'binding': 0.09;
'namespace': 0.09; 'yes.': 0.09; 'bindings': 0.16; 'cameron':
0.16; 'defined.': 0.16; 'from:addr:grant.b.edwards': 0.16;
'from:name:grant edwards': 0.16; 'question,': 0.16; 'simpson':
0.16; 'subject:being': 0.16; 'subject:reference': 0.16; 'wrote:':
0.16; 'grant': 0.17; 'name.': 0.19; 'to:addr:python-list': 0.20;
"isn't": 0.27; 'function': 0.27; 'sense': 0.28; 'header:User-
Agent:1': 0.30; 'module': 0.31; "doesn't": 0.32; 'python-list':
0.32; 'there': 0.33; 'same': 0.34; 'from:addr:gmail.com': 0.35;
'source': 0.36; "it's": 0.37; 'limited': 0.62; 'message-
id:invalid': 0.68; 'choice': 0.76; 'global.': 0.84; 'scope': 0.84;
'subject: \n ': 0.84
User-Agent: slrn/1.0.3 (Linux)
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
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: <https://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>
X-Mailman-Original-Message-ID: <4Trnb856LRznVF4@mail.python.org>
X-Mailman-Original-References: <bd2e0672-fc3e-4678-b212-04ab1f45c52c@gmail.com>
<ZepEKCbZNelFasml@cskk.homeip.net>
 by: Grant Edwards - Fri, 8 Mar 2024 13:49 UTC

On 2024-03-07, Cameron Simpson via Python-list <python-list@python.org> wrote:

> Yes. Note that the "global" namespace is the module in which the
> function is defined.

One might argue that "global" isn't a good choice for what to call the
scope in question, since it's not global. It's limited to that source
file. It doesn't make sense to me to call a binding "global", when
there can be multile different "global" bindings of the same name.

--
Grant

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor