Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

The value of a program is proportional to the weight of its output.


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 overridChris Angelico

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

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: rosuav@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: Variable scope inside and outside functions - global statement
being overridden by assignation unless preceded by reference
Date: Sat, 9 Mar 2024 00:57:40 +1100
Lines: 12
Message-ID: <mailman.64.1709906275.3452.python-list@python.org>
References: <bd2e0672-fc3e-4678-b212-04ab1f45c52c@gmail.com>
<ZepEKCbZNelFasml@cskk.homeip.net> <4Trnb856LRznVF4@mail.python.org>
<CAPTjJmqg4AwHpMLZqteK-qiRZwzDoUCLAFvYGku1X4H2f6b_RA@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de 24rFcL/hV7IhdWd/mse70g9e7LZycGVUmMM+OiYU/iqw==
Cancel-Lock: sha1:9FDQcYZz8RY+8M/FkKjvdSVrp3g= sha256:aNoO0IfMEgLCcnUXIjalpXM/wC2dMT4yzK+MU7EYQ9A=
Return-Path: <rosuav@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=Hvw5c5Sw;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.008
X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'mar': 0.07; 'binding':
0.09; 'cc:addr:python-list': 0.09; 'cc:no real name:2**0': 0.14;
'2024': 0.16; 'bindings': 0.16; 'chrisa': 0.16;
'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16;
'question,': 0.16; 'received:mail-lj1-x22a.google.com': 0.16;
'subject:being': 0.16; 'subject:reference': 0.16; 'wrote:': 0.16;
'grant': 0.17; "aren't": 0.19; 'name.': 0.19;
'cc:addr:python.org': 0.20; 'sat,': 0.22; 'cc:2**0': 0.25;
"isn't": 0.27; 'sense': 0.28; "doesn't": 0.32; 'python-list':
0.32; 'message-id:@mail.gmail.com': 0.32; 'there': 0.33; 'same':
0.34; 'header:In-Reply-To:1': 0.34; 'received:google.com': 0.34;
'running': 0.34; 'from:addr:gmail.com': 0.35; 'source': 0.36;
"it's": 0.37; 'limited': 0.62; 'global': 0.73; 'choice': 0.76;
'global.': 0.84; 'scope': 0.84; 'subject: \n ': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1709906272; x=1710511072; darn=python.org;
h=cc:to:subject:message-id:date:from:in-reply-to:references
:mime-version:from:to:cc:subject:date:message-id:reply-to;
bh=hgYlRG5ym89W4yZ4MC/g1wN4L4U8y11IEblVStpgVSk=;
b=Hvw5c5SwFclKW2xm2NQ0RyhoGsFJUmqK53efjx/Om84OLlox6Em0LX8xxAN/ai1X60
V/u+/oRcnpLD9E2WqFup8yMNfTW/5DNYtRnmEKqe2cFZt2wjuGdcSAn+9p5gPmMACYgO
jGcOWk9OfrqvBsGv8Ijr13wvc8vNDVvZu5gOVZDSNVTv6K/5RmDMEGxAuLPp+tBYwXtR
TveqDG4TLO9al/uUaYLB9bmuPcz8CoH8NHzYogXmmkoVoK3ZQrEBDSvtXagiDJkTHtgo
ERbKkPjUIHjLe6Q1syAyGUgMRYmT/oHSNttrWy9axrxmyqIak/07som4LiOPMmKsBO7M
4GvA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1709906272; x=1710511072;
h=cc:to:subject:message-id:date:from:in-reply-to:references
:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=hgYlRG5ym89W4yZ4MC/g1wN4L4U8y11IEblVStpgVSk=;
b=U5alQfziClhBGl0QG+8lBCuoPYCZW4bbYpW5svUx/punN9u7IiDGR5jbW3oRbMAKrS
mX6MIFU8clKn4cLK5B7PHXrSxvSzqGuN53XfTP2DZHb5Yj4OMnzLrrFGgMJ739wxHuEa
xgL43j0LERIAhBRXLUBMPic9x4Lr37GoUbnhlwrtFA3FZoZ81d4Jcy0zvAnErhKnHjOe
G9pqrWXqot4qSpGjwbdVzfioBNBKo1hPdEzB9W8mOj5WH0c3BMmuExsEiFPw3VjYj5fH
Czr/CYbcXqxQI7joLk2Lh9tv1zMKX4w/y7A6I0WW9IpZUe4/p21d8pqXqA+kko69TGyB
fqDw==
X-Gm-Message-State: AOJu0YzKwogkSXa7PCdHW3Ix7v4hm5qzlDhd/HybILD7QE65uy8jGVqs
peKV3Sd2bvQ+/i3B5lb5bgs/bpOdnxMEwU+9coQPezrWuxnny4eJbX2jITRQAMoDBsxamiPFr2/
0JuNVhQSNeaQzoSuxr8+X34sJR20=
X-Google-Smtp-Source: AGHT+IEG10qxxrQcJY2JFRTT9HItfnFtgDLaOJBVoElmpTWNa17sznLwuksdL4wnKcWlUorXh6tLk1rVwrwCZPj1Jtk=
X-Received: by 2002:a05:651c:793:b0:2d2:864c:8467 with SMTP id
g19-20020a05651c079300b002d2864c8467mr99316lje.20.1709906272039; Fri, 08 Mar
2024 05:57:52 -0800 (PST)
In-Reply-To: <4Trnb856LRznVF4@mail.python.org>
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: <CAPTjJmqg4AwHpMLZqteK-qiRZwzDoUCLAFvYGku1X4H2f6b_RA@mail.gmail.com>
X-Mailman-Original-References: <bd2e0672-fc3e-4678-b212-04ab1f45c52c@gmail.com>
<ZepEKCbZNelFasml@cskk.homeip.net> <4Trnb856LRznVF4@mail.python.org>
 by: Chris Angelico - Fri, 8 Mar 2024 13:57 UTC

On Sat, 9 Mar 2024 at 00:51, Grant Edwards via Python-list
<python-list@python.org> wrote:
> 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.
>

Most "globals" aren't global either, since you can have different
globals in different running applications.

ChrisA

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor