Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Only a fool fights in a burning house. -- Kank the Klingon, "Day of the Dove", stardate unknown


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 overridJacob Kruger

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

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: jacob.kruger.work@gmail.com (Jacob Kruger)
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 18:50:31 +0200
Lines: 30
Message-ID: <mailman.50.1709743840.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>
<1479f660-61e8-45f1-9490-930140c6b1b4@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de gabI2DXzUG3inK2QTcnPcg0EH+CnVe+AD3xK3EzcH6sQ==
Cancel-Lock: sha1:a0YZFXqM9t8ernhDlrf0aZhuyQY= sha256:wl4L8M6OA+4i98nCGKrbCQ/Iy2haHDxGKeTbA0aSFmE=
Return-Path: <jacob.kruger.work@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=GfAW72oK;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.025
X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'likewise': 0.09; 'line:':
0.09; 'roel': 0.09; 'schroeven': 0.09; 'import': 0.15; '"import':
0.16; 'confusion.': 0.16; 'executed': 0.16; 'expected.': 0.16;
'idle.': 0.16; 'interpreter': 0.16; 'ipython,': 0.16; 'schreef':
0.16; 'script,': 0.16; 'subject:being': 0.16; 'subject:reference':
0.16; 'wrote:': 0.16; 'python': 0.16; 'message-id:@gmail.com':
0.18; 'to:addr:python-list': 0.20; 'maybe': 0.22; 'code': 0.23;
'command': 0.23; 'seems': 0.26; 'interact': 0.26; 'it,': 0.29;
'header:User-Agent:1': 0.30; 'whole': 0.30; 'code,': 0.31;
'python-list': 0.32; 'received:192.168.1': 0.32; 'windows': 0.34;
'same': 0.34; 'mean': 0.34; 'header:In-Reply-To:1': 0.34;
'received:google.com': 0.34; 'following': 0.35;
'from:addr:gmail.com': 0.35; 'people': 0.36; 'received:192.168':
0.37; 'file': 0.38; 'way': 0.38; 'put': 0.38; 'forms': 0.40;
'something': 0.40; 'here': 0.62; 'key': 0.64; 'your': 0.64; 'saw':
0.65; 'time.': 0.66; 'generally': 0.67; 'exactly': 0.68; 'and,':
0.69; 'within': 0.69; "you'll": 0.73; 'skip:f 20': 0.75;
'executing': 0.84; 'subject: \n ': 0.84; 'mail,': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1709743838; x=1710348638; darn=python.org;
h=content-transfer-encoding:in-reply-to:from:references:to
:content-language:subject:user-agent:mime-version:date:message-id
:from:to:cc:subject:date:message-id:reply-to;
bh=6SmWkYcdZiuSG+0EOD0dvj8aVUrLgmyp71op+RXBkw0=;
b=GfAW72oK7cPWD8CoLRdVtUNS5XlRm5gAV11+9TsJ5lc2qcXgD7VfW8wX2RGovEVAbX
pWzxAWqOiO7Jlq3UrAI8Rn6XhHRZT8taqQgLOvHfqBhXk24TFlq/PDhTupNtc2HHb82S
hHhpGh7q8/7ujPbuCzQReg5Q1y7Z6l3qD71WaCS5i50rvaVzhXAXBrPeCMSHQcX44bPO
O3hQMMEm19oT4UXGZ68UryNPFCqAY7EXncZPQfYKONQN0YzHFkDmW4Tb6rahTwIMFAny
LHpb1E/WISX/Kh+a6XostQE6i2W+VJEswNx0xnhocn0xKCew4i6989K9xz+b+r2i+Vp+
DE/w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1709743838; x=1710348638;
h=content-transfer-encoding:in-reply-to:from:references:to
:content-language:subject:user-agent:mime-version:date:message-id
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
bh=6SmWkYcdZiuSG+0EOD0dvj8aVUrLgmyp71op+RXBkw0=;
b=AbM52940PcuJiO717epdOqyrK1Sp4ORjnXsNzt+nzYE+cXjrJMJSF8aQuMrVgTedk/
lg3nHaAu68EfofLbgg+iV72F8vE62Kjc1GcE64LguZyLA4+MtYkNhbXB4mE9IVY1oIS0
qH9oGu5Me+VOqBHrw7fVBxet/ffft1mcMDAhP0ROXRWecphCsHRP0rarkh1XILuqeJwO
7d+1QZG0/6sCRQbhAv5KdFbI9Vt9PnJiHbJ88hapQhXUQjuxc96as7EaXqyBzcCjnVUk
i+0y9i8rBpNiDTlIvhCfetKw+RJOGVtb8NkpVjd/vnscOiuq6L8sKgXZ3Bb+JC+oQC+A
VNuw==
X-Gm-Message-State: AOJu0YzCtXUU1N5hHSL2vyG6s6x+plgGe1Y0sezjm2nnTiSm1g6VHV2C
W6iIgmYg6VNrzElcoz2wcb2qLPj+qADLASaEwedkleWPGhlBlEZgueauD1Ya
X-Google-Smtp-Source: AGHT+IHiBEF1RkKvOWk0aCoSOP8x9rimnMF+FIz/CG0bx1KTauj8QONc9R0ETAzY7utJnd00VlT2uw==
X-Received: by 2002:a17:906:5fd3:b0:a45:ac0f:38e4 with SMTP id
k19-20020a1709065fd300b00a45ac0f38e4mr3319357ejv.38.1709743838299;
Wed, 06 Mar 2024 08:50:38 -0800 (PST)
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <b42cb52d-a524-4a20-a4a6-4b04622052e0@roelschroeven.net>
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: <1479f660-61e8-45f1-9490-930140c6b1b4@gmail.com>
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>
<b42cb52d-a524-4a20-a4a6-4b04622052e0@roelschroeven.net>
 by: Jacob Kruger - Wed, 6 Mar 2024 16:50 UTC

You'll see more details in other mail, but, here I am firing up standard
python interpreter from within windows terminal, and then executing
following line:

from scoping2 import *

And, this is under windows 11 windows terminal, which is where I
generally interact with my python code, via command line - generally
working with flask, and/or other forms of command line interaction, most
of the time.

Jacob Kruger
+2782 413 4791
"Resistance is futile!...Acceptance is versatile..."

On 2024/03/06 17:39, Roel Schroeven via Python-list wrote:
> 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.
>

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor