Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

<< WAIT >>


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 overridRoel Schroeven

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

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: roel@roelschroeven.net (Roel Schroeven)
Newsgroups: comp.lang.python
Subject: Re: Variable scope inside and outside functions - global statement
being overridden by assignation unless preceded by reference
Date: Wed, 6 Mar 2024 16:39:09 +0100
Lines: 17
Message-ID: <mailman.46.1709739556.3452.python-list@python.org>
References: <aff560df-2f57-47d9-ad81-74c21960c21d@gmail.com>
<0ccad7a9-eaba-48e6-b972-d89e5a930c11@DancesWithMice.info>
<db322a1b-2d29-4b67-9d5c-3e8d8737c0f5@gmail.com>
<b42cb52d-a524-4a20-a4a6-4b04622052e0@roelschroeven.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de s4V7gEsFHnYwg9Yg+4EGygWQdK53X6JaK+jWzkga4ZIA==
Cancel-Lock: sha1:UnMSsS8T2dPMPy8E5ZLIBUBS4mc= sha256:h/JrHz7a8xscOMQ93RyJIY+aC9dhvPeYA6BDuB+WZeE=
Return-Path: <roel@roelschroeven.net>
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=roelschroeven.net header.i=@roelschroeven.net
header.b=J48xAjDI; dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.016
X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'likewise': 0.09; 'import':
0.15; '"import': 0.16; 'confusion.': 0.16; 'executed': 0.16;
'expected.': 0.16; 'idle.': 0.16; 'ipython,': 0.16;
'received:10.202': 0.16; 'received:10.202.2': 0.16;
'received:10.202.2.163': 0.16; 'received:64.147': 0.16;
'received:64.147.123': 0.16; 'received:internal': 0.16;
'received:messagingengine.com': 0.16; 'rien': 0.16; 'schreef':
0.16; 'script,': 0.16; 'subject:being': 0.16; 'subject:reference':
0.16; 'python': 0.16; 'to:addr:python-list': 0.20; 'maybe': 0.22;
'code': 0.23; 'seems': 0.26; 'it,': 0.29; 'header:User-Agent:1':
0.30; 'whole': 0.30; 'same': 0.34; 'mean': 0.34; 'header:In-Reply-
To:1': 0.34; 'people': 0.36; 'file': 0.38; 'way': 0.38; 'put':
0.38; '8bit%:14': 0.38; 'something': 0.40; 'key': 0.64; 'your':
0.64; 'saw': 0.65; 'received:64': 0.67; 'exactly': 0.68; 'plus':
0.73; 'non': 0.75; 'que': 0.84; 'mais': 0.84; 'soit': 0.84;
'subject: \n ': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
roelschroeven.net; h=cc:content-transfer-encoding:content-type
:content-type:date:date:from:from:in-reply-to:in-reply-to
:message-id:mime-version:references:reply-to:subject:subject:to
:to; s=fm3; t=1709739551; x=1709825951; bh=asFlANwQt1fu9bkY9GaOE
V5kENPCIBtC1GKQBgP3amc=; b=J48xAjDIKocRHMGX9UOhciWu+MRgVQGDkMVZD
xFt+pscbh4MXm4xE633WNuib2tojodg3wlyhgXbdDstEn3zNEvKhOm9Ojdzphmam
cK4+du1qyBPlQsKYM0SSsqyzil1cUqjbY0FRhDpZ5l85jEkugmMLSPhLGAlTQhLp
MJxgpfe+DNywJpOyrvKKwaGzTDxQjiDrasbVgEb4jMo8et8++CB9pCnbpxxACnVu
JHbcmwiW6M/ye9Xucr1Y7ggoSwLeUvmnu3sW+VM+HUDOiT3jqsMPG/UR4EY2HTik
qeIqsrQsZ9U0A8dBxcpSRv1pffVjmmsbvM1NkhCCRzh2QyL0g==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
messagingengine.com; h=cc:content-transfer-encoding:content-type
:content-type:date:date:feedback-id:feedback-id:from:from
:in-reply-to:in-reply-to:message-id:mime-version:references
:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy
:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1709739551; x=
1709825951; bh=asFlANwQt1fu9bkY9GaOEV5kENPCIBtC1GKQBgP3amc=; b=m
dejLvyRSU0YWt43ZzcKMpduOFBwMcQgXIimA28vNNiFiq0usOC1BbSvxIWo2EXJT
o3SbleBx0DyIcpgfDLD+KW4dn0hiSp+A8wgJZ8YHJ17nMYaPzNxEk0379Kj2lRO7
CZGwxgww73YLrwl4oRw3gvAbXaIdPvFO3/jqgJH08BzI7/rJGJcMYhL9ObQ6LAEo
78YMWFaf2bUGwgEL+VRQ5CVihq/lSFM1WEMR8qL+OCtmE6a4TRUuKdZ4ag1yEItG
9e/BKx2n3uBPXg+8OeV08EW79w3X0SmzMpjlT3Mr4x222GKl2uJZs9e2Ye3RPkTx
Hr65D1Q9zO3BNBLxsyTzw==
X-ME-Sender: <xms:H47oZQSwpwrDllHPPv1aPq1FgO99owPZuVR8nYelc81WdSYV0d8VKA>
<xme:H47oZdylLzXwR50FU5KbDMESbS6fpYckIzHTV29z5cUaJNyc0NJyW8zhsHA6WlBJE
4CWHCYkMlq2>
X-ME-Received: <xmr:H47oZd2efRoVmCrM-8uqcSKMFJYiTKWJ6dUt9_xnLCRVJdc6Zbb_OpkQrEZw7pO5uJJ0NI6ZaDQLQO6UQ-WHYgWsVfb3ytJZAauW2dOLV4l3wgQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledriedugdejhecutefuodetggdotefrodftvf
curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
uegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthekre
dttddvjeenucfhrhhomheptfhovghlucfutghhrhhovghvvghnuceorhhovghlsehrohgv
lhhstghhrhhovghvvghnrdhnvghtqeenucggtffrrghtthgvrhhnpeegjeffkeegvdevje
ejhfegtddvhefhiefhleefhffgiedtvdeigeeiieegvdduhfenucevlhhushhtvghrufhi
iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehrohgvlhesrhhovghlshgthhhroh
gvvhgvnhdrnhgvth
X-ME-Proxy: <xmx:H47oZUCe1oJ2VxODRnjemVTBHnpRB6GRGhpc3YBSrlC7PhrFBl_RVQ>
<xmx:H47oZZil0iZAWjm8F8E3pXZ9UXVgxqY5bUBQYIbNioYva2BzpJO8yg>
<xmx:H47oZQqufcH6AbQdw_294R8tCFjEU-IbZ_JU2X4bOXRHPu6jjQ2FnA>
<xmx:H47oZZYxi-RxqnNsoDAMFg9S18R8owX3l982cB4BxmqTDVTdKQVIfVf8jmM>
Feedback-ID: i8e5b41ae:Fastmail
User-Agent: Mozilla Thunderbird
Content-Language: nl, en-US
In-Reply-To: <db322a1b-2d29-4b67-9d5c-3e8d8737c0f5@gmail.com>
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: <b42cb52d-a524-4a20-a4a6-4b04622052e0@roelschroeven.net>
X-Mailman-Original-References: <aff560df-2f57-47d9-ad81-74c21960c21d@gmail.com>
<0ccad7a9-eaba-48e6-b972-d89e5a930c11@DancesWithMice.info>
<db322a1b-2d29-4b67-9d5c-3e8d8737c0f5@gmail.com>
 by: Roel Schroeven - Wed, 6 Mar 2024 15:39 UTC

Op 6/03/2024 om 13:55 schreef Jacob Kruger via Python-list:
> If you import the contents of that file into the python interpreter, [...]

What exactly to you mean by "import the contents of that file into the
python interpreter"? Other people have put your code in a script,
executed it, and saw it working as expected. I pasted in IPython, and
likewise saw it working as expected, and the same with IDLE. It seems to
me you must be doing something different from us; maybe the way you
execute that code might be the key to this whole confusion.

--
"Il semble que la perfection soit atteinte non quand il n'y a plus rien à
ajouter, mais quand il n'y a plus rien à retrancher."
"Perfectie is niet bereikt als er niets meer toe te voegen is, maar als er
niets meer weg te nemen is."
-- Antoine de Saint-Exupéry

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor