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 ...hw

1
Re: learning python ...

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: hw...@adminart.net (hw)
Newsgroups: comp.lang.python
Subject: Re: learning python ...
Date: Tue, 25 May 2021 05:53:27 +0200
Lines: 58
Message-ID: <mailman.323.1621914809.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>
<f5f53e28-57c9-eeb5-bf3e-a82ce9b2167b@adminart.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de VGfKbklr1duf6RHEwa1EhQXFJZyC07mI0iWXC/uDu6DQ==
Return-Path: <hw@adminart.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=adminart.net header.i=@adminart.net header.b=l5/K56GH;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.004
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '(which': 0.04; 'string':
0.05; 'variable': 0.05; 'subject:python': 0.06; 'that?': 0.07;
'int': 0.09; 'objects,': 0.09; 'string,': 0.09; '(unless': 0.16;
'ambiguity': 0.16; 'compiled': 0.16; 'furthermore,': 0.16;
'integer': 0.16; 'num': 0.16; 'objects.': 0.16; 'one?': 0.16;
'received:(client did not present a certificate)': 0.16;
'simpson': 0.16; 'something.': 0.16; 'variable,': 0.16;
'variable.': 0.16; 'wrote:': 0.16; 'memory': 0.16; 'python': 0.16;
'uses': 0.19; 'pm,': 0.20; "i've": 0.22; 'to:addr:python-list':
0.23; 'lines': 0.24; 'received:de': 0.24; 'cannot': 0.24;
'thinking': 0.26; 'seems': 0.26; 'else': 0.27; 'old': 0.28;
'this?': 0.28; "isn't": 0.29; 'local': 0.29; 'header:User-
Agent:1': 0.31; 'it,': 0.31; 'there': 0.31; 'think': 0.31; 'but':
0.31; 'am,': 0.31; "doesn't": 0.32; 'guess': 0.32; 'language.':
0.32; 'header:In-Reply-To:1': 0.33; 'same': 0.34; 'one.': 0.35;
'yes,': 0.35; 'change': 0.37; 'something': 0.38; 'does': 0.38;
'example': 0.40; 'could': 0.40; 'reference': 0.61; 'hope': 0.61;
'them,': 0.63; 'back': 0.65; 'becomes': 0.65; 'number:': 0.66;
'forget': 0.68; 'matter': 0.69; 'michael': 0.69; 'changing': 0.69;
'interesting': 0.71; 'global': 0.72; 'content': 0.72; 'yes': 0.77;
'practical': 0.84; 'strings': 0.84; 'weird': 0.84; 'line,': 0.93
ARC-Seal: i=1; a=rsa-sha256; t=1621914807; cv=none;
d=strato.com; s=strato-dkim-0002;
b=BUtTcDEwpH0GnnEKL4F6Mkw+qb+JlH5deR2fkixDXS8YdDNeBJj6otveZXrYD6pR59
9XDDeqfMix1T8O+ma54Pqs6GN+wmSFA3fOJXtV0KY3rULIhQvhWacagkNQEC4c1fF91D
sWSqPCyOt5Ton6B2Pv28WTwS9hP/jtXsYMw3539zZcgUo/tIvESiERUo44GkXo40Apgh
5g2SlPhZzLFfrlvVcdPKHIIX4TQxjzFqd8XjGDzL6v3i73q5JFmVC4GN8/Xa2Fm08nqG
7XRZFk0LzYYSxZZi/chXOitCVN3KpEZYhbomZzK7XXsOw6q9Ye7Z5E5B2RQSfcaJ1Wof
D6SA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1621914807;
s=strato-dkim-0002; d=strato.com;
h=In-Reply-To:Date:Message-ID:From:References:To:Subject:Cc:Date:From:
Subject:Sender;
bh=jH6FdG4LN5sIV4OIL4vem+8Bxrnq6tHV8H1p/qZnEM8=;
b=fgNnz+PtyHvpsYl+s4BcYg/L3t+BE6yHXQrF3w/sqCloL45MUR6aEgUljE8I+B+hN0
v+VQpue7OSGBboqiDs5ZTjg8V7Q5aeHJhrel3bS7OUk+rS80jlkqOAFozlEoPmfERXrT
oo7YE4xP1pI6rrjrHG/UN/lAvtryEEGOKOF4IgLmObjVzdqrIkevQ6gELJk5x4M6QZCa
4nXFz+BHTKO11wkhOuIz94/zhaHFyf2dAfGzmlUiieY63LE7FYBIeCV1b8j7RlMzbXru
dhGGNuHYgRADKCm2Cq5NohJT60ebzCvX9bC/sX0A/C5Gg63cmiNEZnVM9xuiW4CZB3bo
ETgg==
ARC-Authentication-Results: i=1; strato.com;
dkim=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1621914807;
s=strato-dkim-0002; d=adminart.net;
h=In-Reply-To:Date:Message-ID:From:References:To:Subject:Cc:Date:From:
Subject:Sender;
bh=jH6FdG4LN5sIV4OIL4vem+8Bxrnq6tHV8H1p/qZnEM8=;
b=l5/K56GHh+lYpZ/XcYodBKeoGCYNERSFdIZULGY3mTO5sb0jyuMh3u8icYdsy5lUpe
+DF1QU6dmmdAO313/ojB4vF5/E/orsqFdd0Y0E6Y2IHbnGSwqX773wCStkmD0og5Zwmd
3dRj6xG8LAKzrRU3Vi5azQFtozjm4vmWZ4PJ72EIVYK124Ujyb1tdKX6mz7H8WIyooUT
iilEtOs9FRXC3jN+7rn6y4Ry0O6jOQA7nHrHb1SMXyVHp1rU1DRCEWhx3IqiVIrebY8s
3TYOLt90q+UY2hh7srLXzWw7asbduKnuTLFj1KZ58n1OHKlCSwWmr0xnAspUBhpKH3pW
98RA==
Authentication-Results: strato.com;
dkim=none
X-RZG-AUTH: ":O2kGeEG7b/pS1Ey9Rna9iAZFrfz26y6zbtmqiE/f0+LThi5xYO8s9RmVPkxvrwQpRPenk8HVxDf4aQ=="
X-RZG-CLASS-ID: mo00
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.10.1
In-Reply-To: <aa786fa5-4e27-7781-87f6-e21da8c64d9d@gmail.com>
Content-Language: de-DE
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: <f5f53e28-57c9-eeb5-bf3e-a82ce9b2167b@adminart.net>
X-Mailman-Original-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>
 by: hw - Tue, 25 May 2021 03:53 UTC

On 5/24/21 4:28 PM, Michael Torrie wrote:
> 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)

yes

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

So the other example that uses a second variable to avoid possible
ambiguity could be considered as bloating because it keeps both
variables around.

>> 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.

That seems like an important distinction. I've always been thinking of
variables that get something assigned to them, not as something that is
being assigned to something.

> 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.

I would think of it as assigning a string to a variable and then
changing the content of the variable by assigning something else to the
same variable. When variables are typeless, it doesn't matter if a
string or an integer is assigned to one (which is weird but can be very
useful).

It seems much more practical to assign different strings to the same
variable rather than assigning a different variable to each string, or
to assign a string to a variable and then to assign an integer to it.

Isn't that what variables are for?

> 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.
>
>

Yes, I guess it will be interesting not to think of variables but of
objects.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor