Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Ninety percent of baseball is half mental." -- Yogi Berra


devel / comp.lang.python / Re: Negative subscripts

SubjectAuthor
o Re: Negative subscriptsdn

1
Re: Negative subscripts

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: PythonL...@DancesWithMice.info (dn)
Newsgroups: comp.lang.python
Subject: Re: Negative subscripts
Date: Tue, 30 Nov 2021 08:44:03 +1300
Organization: DWM
Lines: 50
Message-ID: <mailman.52.1638215058.9869.python-list@python.org>
References: <96741f1a-72b3-6551-39b3-f1862c5a80b8@chagford.com>
<ba4a976c-5829-03ac-2e3f-cf670f00c3f7@DancesWithMice.info>
<1c37f528-250c-85b5-5e98-2ccde350438b@chagford.com>
<c21483f1-9d14-968d-7d75-aa1ca3f90cc0@DancesWithMice.info>
<CAPTjJmoHcEB5GJnEpmq-B18qz6eX2u8_qLhGkSKv0kr-V7cYcw@mail.gmail.com>
<90500dcf-fb29-4923-6004-d16e338068b8@DancesWithMice.info>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de 6GTipRnV1XvQq6qNobOoBQT1w3GPo4LRKehhHpdVNCGA==
Return-Path: <PythonList@DancesWithMice.info>
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=danceswithmice.info header.i=@danceswithmice.info
header.b=EfHj8JAr; dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.005
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '(which': 0.04; 'is.':
0.05; 'coder': 0.07; 'loop': 0.07; '27,': 0.09; '=dn': 0.09;
'angelico': 0.09; 'depend': 0.09; 'expression': 0.09;
'from:addr:danceswithmice.info': 0.09; 'from:addr:pythonlist':
0.09; "hasn't": 0.09; "list's": 0.09; 'unlike': 0.09;
'url:reference': 0.09; 'assignments': 0.16; 'evaluated': 0.16;
'evaluating': 0.16; 'executed': 0.16; 'interpreter': 0.16;
'iterable': 0.16; 'looping': 0.16; 'message-
id:@DancesWithMice.info': 0.16; 'object,': 0.16; 'present,': 0.16;
'received:51.254': 0.16; 'received:51.254.211': 0.16;
'received:51.254.211.219': 0.16; 'received:cloud': 0.16;
'received:rangi.cloud': 0.16; 'text)': 0.16; 'yield': 0.16;
'wrote:': 0.16; 'to:addr:python-list': 0.20; 'application.': 0.22;
'sat,': 0.22; '(and': 0.25; 'seems': 0.26; 'else': 0.27; 'chris':
0.28; 'header:User-Agent:1': 0.30; 'header:Organization:1': 0.31;
'wondering': 0.31; "doesn't": 0.32; 'empty': 0.32; 'python-list':
0.32; 'said,': 0.32; "i'm": 0.33; 'particular': 0.33; 'header:In-
Reply-To:1': 0.34; 'item': 0.35; 'yes,': 0.35; 'target': 0.36;
'using': 0.37; 'received:192.168': 0.37; 'list': 0.39;
'evaluation': 0.39; '(see': 0.40; 'should': 0.40; 'in,': 0.60;
"there's": 0.61; 'gives': 0.62; 'true': 0.63; 'once': 0.63;
'definition': 0.64; 'received:51': 0.64; 'upon': 0.64;
'received:userid': 0.66; 'items': 0.68; 'during': 0.69; 'further':
0.69; 'order': 0.69; 'generator': 0.69; 'sequence': 0.69; 'terms':
0.70; 'rules': 0.70; '2021': 0.71; 'suite': 0.71; 'features':
0.75; 'produces': 0.76; 'life': 0.77; 'returned': 0.81;
'eventually': 0.84; 'further,': 0.84; 'proceed,': 0.84; 'thus,':
0.84; 'amended': 0.91; 'anticipated': 0.91
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on vps517507.ovh.net
X-Spam-Level:
X-Spam-Status: No, score=-4.3 required=5.0 tests=ALL_TRUSTED,BAYES_00,
DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,NICE_REPLY_A autolearn=ham
autolearn_force=no version=3.4.0
DKIM-Filter: OpenDKIM Filter v2.11.0 mail.rangi.cloud D8A6C59C8
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=danceswithmice.info;
s=staff; t=1638215055;
bh=dUO9TQ/boGGDPjpW8LuWqgiSVGcsjlR1/imAzaxk3Io=;
h=Date:Subject:To:References:From:In-Reply-To:From;
b=EfHj8JArAYSljpam8SAVhNxRQS+XddPBogCKyf7v7EodiDg5taFsO4u+NryoJNM0T
1i2GNy6dzWAKmJkSg79bmfH29cSyKlKwPX9m/gTrk6vAGf+19b1n9g6rL4RYvNrsri
PPuAQ5zLF6P7nc4NUWALasS49+aBRkzQIWYhCs2Qd0w8cvJAUA0Mv/Yl++m5z3FYgU
w1c418/onWFoXhV4dxnPVCc6xfomn5Sd54IaMG6ZqHLgkpVUt/6fJvJbWsmSBPPmy3
Ou2PoIsI7y1bvXe+9arNySsz6Xszw0sNJuzO5gR1zsALOPQZ9ljCnivwcq2uF1LSfW
1VNCYRKiz+B3g==
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.3.2
Content-Language: en-GB
In-Reply-To: <CAPTjJmoHcEB5GJnEpmq-B18qz6eX2u8_qLhGkSKv0kr-V7cYcw@mail.gmail.com>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.37
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: <90500dcf-fb29-4923-6004-d16e338068b8@DancesWithMice.info>
X-Mailman-Original-References: <96741f1a-72b3-6551-39b3-f1862c5a80b8@chagford.com>
<ba4a976c-5829-03ac-2e3f-cf670f00c3f7@DancesWithMice.info>
<1c37f528-250c-85b5-5e98-2ccde350438b@chagford.com>
<c21483f1-9d14-968d-7d75-aa1ca3f90cc0@DancesWithMice.info>
<CAPTjJmoHcEB5GJnEpmq-B18qz6eX2u8_qLhGkSKv0kr-V7cYcw@mail.gmail.com>
 by: dn - Mon, 29 Nov 2021 19:44 UTC

On 27/11/2021 21.23, Chris Angelico wrote:
> On Sat, Nov 27, 2021 at 7:21 PM dn via Python-list
> <python-list@python.org> wrote:
>> The expression list is evaluated once; it should yield an iterable
>> object. An iterator is created for the result of the expression_list.
>> The suite is then executed once for each item provided by the iterator,
>> in the order returned by the iterator. Each item in turn is assigned to
>> the target list using the standard rules for assignments (see Assignment
>> statements), and then the suite is executed. When the items are
>> exhausted (which is immediately when the sequence is empty or an
>> iterator raises a StopIteration exception), the suite in the else
>> clause, if present, is executed, and the loop terminates.
>> ยป
>> https://docs.python.org/3/reference/compound_stmts.html#the-for-statement
>>
>>
>> That said, I'm wondering if all is strictly true when the
>> expression_list is a generator, which by definition features
>> lazy-execution rather than up-front list production. So, things may
>> depend upon the full-nature of the application.
>
> Yes, it is. Evaluating a generator expression gives you a generator
> object, which is an iterable.

You (and the text) are correct - the expression list is "evaluated once"
and produces a generator object. For a particular understanding of
"evaluate".

However, as described, all that has been "evaluated" is a
generator-object. Unlike (say) a list's iterator, a generator only
eventually produces a 'list' - and each time the generator is
called-upon to yield the next value, that value has to be "evaluated",
ie there's some further evaluation loop-by-loop.

Further, that the values-returned can be amended during the life of the
generator (in ways anticipated and unanticipated by coder and
interpreter alike). Thus, it seems that the "list" doesn't actually
exist, as in, hasn't been "evaluated" as data-values, when the loop is
enacted.

What has been 'evaluated' are the terms by which the looping will
proceed, and terminate.

--
Regards,
=dn

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor