Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

6 May, 2024: The networking issue during the past two days has been identified and fixed.


devel / comp.lang.python / Re: learning python ...

SubjectAuthor
o Re: learning python ...Michael Torrie

1
Re: learning python ...

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: torr...@gmail.com (Michael Torrie)
Newsgroups: comp.lang.python
Subject: Re: learning python ...
Date: Mon, 24 May 2021 08:28:42 -0600
Lines: 28
Message-ID: <mailman.300.1621866527.3087.python-list@python.org>
References: <7dc017ca-c0a3-c66e-8b7c-ceea1c786c73@adminart.net>
<YKty/XyqeCBH9rcH@cskk.homeip.net>
<2ba5b89e-df8c-df0f-5a18-57852aa3a8bb@adminart.net>
<aa786fa5-4e27-7781-87f6-e21da8c64d9d@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de V98FU95h2+3kJ9x2mLWDGwrhXOD666d3rK5+VM3OOReA==
Return-Path: <torriem@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=VDucdNSc;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.002
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'string': 0.05; 'variable':
0.05; 'subject:python': 0.06; 'that?': 0.07; 'int': 0.09;
'objects,': 0.09; '(unless': 0.16; 'compiled': 0.16;
'furthermore,': 0.16; 'num': 0.16; 'one?': 0.16;
'received:209.85.215': 0.16; 'received:209.85.215.171': 0.16;
'received:mail-pg1-f171.google.com': 0.16; 'simpson': 0.16;
'variable,': 0.16; 'variable.': 0.16; 'wrote:': 0.16; 'memory':
0.16; 'python': 0.16; 'message-id:@gmail.com': 0.19; 'to:addr
:python-list': 0.23; 'lines': 0.24; 'cannot': 0.24; 'old': 0.28;
'this?': 0.28; 'local': 0.29; 'header:User-Agent:1': 0.31; 'it,':
0.31; 'there': 0.31; 'am,': 0.31; "doesn't": 0.32; 'language.':
0.32; 'header:In-Reply-To:1': 0.33; 'same': 0.34;
'received:google.com': 0.34; 'one.': 0.35; 'from:addr:gmail.com':
0.35; 'received:192.168': 0.37; 'change': 0.37; 'received:209.85':
0.38; 'received:209': 0.38; 'does': 0.38; 'reference': 0.61;
'hope': 0.61; 'back': 0.65; 'becomes': 0.65; 'number:': 0.66;
'forget': 0.68; 'global': 0.72; 'line,': 0.93
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
h=subject:to:references:from:message-id:date:user-agent:mime-version
:in-reply-to:content-language:content-transfer-encoding;
bh=jSMebx/upqxkutlUINtKfSna3p1ajckmjPZlaMaDldI=;
b=VDucdNScAD7dUCDqAQl+RbbYjyN6P+tdEm996rNZPA3FSs74x1slYYwIbHoIg0QkCr
Fhv00vKjFKW7Q0nbBKxiNd53muy1pIAN/8HRfvHHDcqKrcQ0K26NG4+ZAhi6xMQ0jbRZ
XO+svJD8DIwohL8vt1kJQmqTIufE6Rol9BGEQzu6Z1ebZL5+bBio+kQq+VRxtYzRl5kK
lWJL1qURAGG0lrS/NvuK7en1JXlP+sPnE91sr+HvbcZ7+qT8FXv87ktdzKRcAlJ0WL08
xvuEA+BsEixC2uVKwlkNNi7OpUmhe3ZhveF0EtiCR1KFjaih4J3g088FggXPQprcH0IW
zvcA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:subject:to:references:from:message-id:date
:user-agent:mime-version:in-reply-to:content-language
:content-transfer-encoding;
bh=jSMebx/upqxkutlUINtKfSna3p1ajckmjPZlaMaDldI=;
b=YRAYeFOTKrKXgb965fj8iqXr/CfLqWUTg5bLpanXplQfnCthA6wB6OZfBy+jRxRXA5
dNpUE/E5sj2GnyJdT1iU9I1/KdKPHvxzFT5uTNibOyHRplxir998lawLIAoa33ZK92wl
Ev2F7jjteX7UFL2IpEfHV3RlSHbQwNM85Wk0pLYU2ir5djr6hrrxmzhHlAmlyBwfRODe
H1ce/0vG5qjTLLx75QNmqRXM+GUQezClLfPaiQw0G7Obe3rfa6h8fSm86ozosZYEZ0V1
8m41sFsJ/taqJoLty316WKGkiU6gvvhKHn91DEA9hFnUlbydTyWbZ6nACpIGT/R/ZaqU
8DIg==
X-Gm-Message-State: AOAM532YEElhBGiPV22dBuu1Rb7yZWK7nn8jVFhIoU61MqzGD291wgl3
EUMhK5Unx+ODgXqvk6ybHCdkZJENw3Vi5Q==
X-Google-Smtp-Source: ABdhPJwSgSYZs6rcfxfI4ctbSZbd+s9butRNEp4FTUnl7trucLfTcWYTpgrGRo/BJ5yL+qLSkJCnoA==
X-Received: by 2002:aa7:99da:0:b029:2de:4387:9e46 with SMTP id
v26-20020aa799da0000b02902de43879e46mr24815575pfi.55.1621866524130;
Mon, 24 May 2021 07:28:44 -0700 (PDT)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.7.0
In-Reply-To: <2ba5b89e-df8c-df0f-5a18-57852aa3a8bb@adminart.net>
Content-Language: en-US
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
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: <aa786fa5-4e27-7781-87f6-e21da8c64d9d@gmail.com>
X-Mailman-Original-References: <7dc017ca-c0a3-c66e-8b7c-ceea1c786c73@adminart.net>
<YKty/XyqeCBH9rcH@cskk.homeip.net>
<2ba5b89e-df8c-df0f-5a18-57852aa3a8bb@adminart.net>
 by: Michael Torrie - Mon, 24 May 2021 14:28 UTC

On 5/24/21 8:17 AM, hw wrote:
> What does python actually do in the first example? Does it overshadow a
> variable or does it change one? If it overshadows a variable, it would
> be dubious, if it doesn't, it won't be dubious.

Are you referring to this?

num = input("Enter a number: ")
num = int(num)

No it is not "overshadowing" a variable. You cannot get back to the
original string value for num.

> There are more alternatives: Python might create a new variable with
> the same name and forget about the old one. Or it doesn't forget about
> the old one and the old one becomes inaccessible (unless you have a
> reference to it, if there is such a thing in python). How do you call that?

Python variables are not memory boxes like in a compiled language. They
are names bound to objects, as Mr Simpson alluded to. So in the first
line, the name num is bound to a string. In the second line, the name
is re-bound to an int object. Furthermore, if num had come from the
global name scope, either of these lines would create a local name num
that does shadow the name from the global scope.

Hope that helps.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor