Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Measure with a micrometer. Mark with chalk. Cut with an axe.


devel / comp.lang.python / Re: Trying to understand nested loops

SubjectAuthor
* Re: Trying to understand nested loopsFrank Millman
`* Re: Trying to understand nested loopsGB
 +- Re: Trying to understand nested loopsGrant Edwards
 +- Re: Trying to understand nested loopsMats Wichmann
 +- RE: Trying to understand nested loops<avi.e.gross
 +- Re: Trying to understand nested loopsDan Stromberg
 +* Re: Trying to understand nested loopsdn
 |`* Re: Trying to understand nested loopsDan Purgert
 | `- Re: Trying to understand nested loopsGB
 +- RE: Trying to understand nested loops<avi.e.gross
 +- Re: Trying to understand nested loopsMladen Gogala
 +- Re: Trying to understand nested loopsDan Stromberg
 +- Re: Trying to understand nested loopsChris Angelico
 +- Re: Trying to understand nested loopsRichard Damon
 +- Re: Trying to understand nested loopsChris Angelico
 +- Re: Trying to understand nested loopsRichard Damon
 +- Re: Trying to understand nested loopsChris Angelico
 `- RE: Trying to understand nested loops<avi.e.gross

1
Re: Trying to understand nested loops

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: fra...@chagford.com (Frank Millman)
Newsgroups: comp.lang.python
Subject: Re: Trying to understand nested loops
Date: Fri, 5 Aug 2022 09:56:03 +0200
Lines: 48
Message-ID: <mailman.200.1659686206.20444.python-list@python.org>
References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de lAtHh/6uIbBB/rExfhujbAMR6nLMbj1Bu0rW9e508bXQ==
Return-Path: <frank@chagford.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.004
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'aug': 0.07; 'loops.':
0.07; 'python.': 0.08; 'console,': 0.09; 'subject:Trying': 0.09;
'questions.': 0.14; "'python'": 0.16; 'answer.': 0.16; 'does,':
0.16; 'from:addr:chagford.com': 0.16; 'from:addr:frank': 0.16;
'from:name:frank millman': 0.16; 'indentation': 0.16; 'loops':
0.16; 'message-id:@chagford.com': 0.16; 'millman': 0.16; 'nested':
0.16; 'preferable': 0.16; 'range(3):': 0.16; 'received:196.35':
0.16; 'received:196.35.198': 0.16; 'received:197.90': 0.16;
'received:197.90.32': 0.16; 'received:197.90.32.26': 0.16;
'received:synaq.com': 0.16; 'subject:nested': 0.16; 'typos.':
0.16; 'wrote:': 0.16; 'python': 0.16; 'to:addr:python-list': 0.20;
'purposes': 0.22; 'code': 0.23; 'python,': 0.25; 'bit': 0.27;
'>>>': 0.28; 'error': 0.29; 'header:User-Agent:1': 0.30; 'am,':
0.31; 'question': 0.32; 'there': 0.33; 'header:In-Reply-To:1':
0.34; 'thanks': 0.38; 'use': 0.39; 'prompt': 0.39; 'learn': 0.40;
'something': 0.40; 'hello,': 0.40; 'should': 0.40; 'in,': 0.60;
'above': 0.62; 'here': 0.62; 'come': 0.62; 'email addr:gmail.com':
0.63; 'feel': 0.63; 'times.': 0.64; 'your': 0.64; 'upon': 0.64;
'back': 0.67; 'received:196': 0.69; 'free': 0.72; '....': 0.76;
'stumbled': 0.76; 'var': 0.81; 'known': 0.84; 'question?': 0.91
Authentication-Results: synaq.com; iprev=fail smtp.remote-ip=197.90.32.26;
auth=pass (PLAIN) smtp.auth=frank@chagford.com;
arc=none
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.12.0
Content-Language: en-US
In-Reply-To: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
X-Red-Router: yes
X-SYNAQ-Pinpoint-Information: Please contact SYNAQ for more information
X-SYNAQ-Pinpoint-ID: 1oJsBV-000BIh-E7
X-SYNAQ-Pinpoint: No virus infections found
X-SYNAQ-Pinpoint-SpamCheck: not spam, SpamAssassin (not cached, score=-1.811,
required 9, autolearn=disabled, ALL_TRUSTED -1.00,
DCC_REPUT_00_12 -0.80, NICE_REPLY_A -0.00,
T_SCC_BODY_TEXT_LINE -0.01)
X-Pinpoint-From: frank@chagford.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: <1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
X-Mailman-Original-References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
 by: Frank Millman - Fri, 5 Aug 2022 07:56 UTC

On 2022-08-05 9:34 AM, ojomooluwatolami675@gmail.com wrote:
> Hello, I’m new to learning python and I stumbled upon a question nested loops. This is the question below. Can you please how they arrived at 9 as the answer. Thanks
>
> var = 0
> for i in range(3):
> for j in range(-2,-7,-2):
> var += 1
> print(var)
>

Welcome to Python. I am sure you are going to enjoy it.

To learn Python, you must learn to use the Python interactive prompt
(also known as the REPL).

Type 'python' at your console, and it should bring up something like this -

C:\Users\E7280>python
Python 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

The confusing part of your example above is 'for j in range(-2,-7,-2)'.

To find out what it does, enter it at the '>>>' prompt -

>>> for j in range(-2, -7, -2):
.... print(j)
....
-2
-4
-6
>>>

For the purposes of your exercise, all you need to know at this stage is
that it loops three times.

Does that help answer your question? If not, feel free to come back with
more questions.

BTW, there is an indentation error in your original post - line 5 should
line up with line 4. It is preferable to copy/paste your code into any
messages posted here rather than type it in, as that avoids the
possibility of any typos.

Frank Millman

Re: Trying to understand nested loops

<tcipgj$347ur$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: NOTsome...@microsoft.invalid (GB)
Newsgroups: comp.lang.python
Subject: Re: Trying to understand nested loops
Date: Fri, 5 Aug 2022 10:56:34 +0100
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <tcipgj$347ur$1@dont-email.me>
References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 5 Aug 2022 09:56:35 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="22c258f5137e048424e90ea001314b1a";
logging-data="3284955"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19naRqFTOxGfoh/1csmmuNC"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:Yl27J/QF0/UHhXUkuf/F4zeB0fk=
Content-Language: en-GB
In-Reply-To: <mailman.200.1659686206.20444.python-list@python.org>
 by: GB - Fri, 5 Aug 2022 09:56 UTC

On 05/08/2022 08:56, Frank Millman wrote:

> BTW, there is an indentation error in your original post - line 5 should
> line up with line 4.

As a Python beginner, I find that Python is annoyingly picky about
indents. And, the significance of indents is a bit of a minefield for
beginners.

For example, in the above code, the indent of the final line very
significantly affects the results:

print(var)
print(var)
print(var)

These are all different.

Re: Trying to understand nested loops

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: grant.b....@gmail.com (Grant Edwards)
Newsgroups: comp.lang.python
Subject: Re: Trying to understand nested loops
Date: Fri, 05 Aug 2022 12:53:59 -0700 (PDT)
Lines: 34
Message-ID: <mailman.204.1659729243.20444.python-list@python.org>
References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me>
<62ed7557.050a0220.1d68f.2d24@mx.google.com>
X-Trace: news.uni-berlin.de zpP6kU5kKh+wWZ7Ucn2OzQx5tV9jcGb+omctnnM3tZMQ==
Return-Path: <grant.b.edwards@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=hvYVdECU;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.007
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'looks': 0.02; 'beginner,':
0.07; 'indeed.': 0.09; 'subject:Trying': 0.09; 'affects': 0.16;
'beginners.': 0.16; 'from:addr:grant.b.edwards': 0.16;
'from:name:grant edwards': 0.16; 'indentation': 0.16;
'subject:nested': 0.16; 'syntax.': 0.16; 'wrote:': 0.16; 'python':
0.16; 'to:addr:python-list': 0.20; 'languages': 0.22;
'programming': 0.25; 'seems': 0.26; 'bit': 0.27; 'example,': 0.28;
'error': 0.29; 'header:User-Agent:1': 0.30; 'code,': 0.31;
"doesn't": 0.32; 'do.': 0.32; 'there': 0.33;
'received:google.com': 0.34; 'final': 0.35; 'received:209.85.166':
0.35; 'from:addr:gmail.com': 0.35; "it's": 0.37;
'received:209.85': 0.37; 'received:209': 0.39; 'should': 0.40;
'above': 0.62; 'me.': 0.62; 'your': 0.64; 'and,': 0.69; "you'll":
0.73; 'supposed': 0.76
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=to:user-agent:references:subject:from:date:message-id:from:to:cc;
bh=XMSgn58be2rNZHMC9YV7WnzDYKOgMdRUAKhI26G4gWM=;
b=hvYVdECU8SW0Qp9fws9NFiWQq/XF33KUauw4z55kwRNzcZWZuF0rfB1pPDpwggZwWJ
t9C5IyeWctWhM4ouNgJ05uP6429WTLqGOw1MPBLBZSeLirC3c2WqQAKcgnZu4Hw9u/nd
3BIIkTf3Amj3amTdqSbrDUkud0trIEOYk1U7TYgU0cNf/ij7Yw/31v8ofuHz/w5qfbxo
b2JfujOO/zrMNVFTWqoIlS+UtfcsmzZ/9JjUKyxNiXXPZiG+tkcen1g5Kke1OmkUEY5e
O8Nnmx60CFeALLZ6NLue8M6s/xEB1sSvFMwwPHBw72dws+eTYV6MywyhaHTEUuwRObnK
VKHg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=to:user-agent:references:subject:from:date:message-id
:x-gm-message-state:from:to:cc;
bh=XMSgn58be2rNZHMC9YV7WnzDYKOgMdRUAKhI26G4gWM=;
b=Hw0mxTnLDcFJbkp5rhceJAqwdICamGYmI14uI+C0/Cfrl6RobzrZ9Y7WihP9sJdBPe
LzrlmEFTjUA+vapfQpOdV4SpW3tDsw5nwQaUGzvAWIE+Mi8yUd2rZmfFd/uw5zf9Zt5s
ySbwI4CeYkP41k3ly/H6xGkboCBy+4pVAVeqcdHWqKw9ekH91wSOXKgqgB2+zI7qSYAH
3Q1aYMEE6TDL/fUXITQwl+aZ2RHJvV/IOmp8EPP0z3GhdFoKaxlxe4aFO/5DQzuEZh60
253rSpzgDjyJcVt/ChOs0GUW3xBv1jCGUlPcLeFyT8Er7ejD6xUFBvjGiOj2GVYe0XGY
F0SQ==
X-Gm-Message-State: ACgBeo0UWNFl3tuFHtPUC8zLE1si2XJ1Ahm0WoNFbL9wmrKsWjmD+/At
v3BFSO+u/x39Zy0mLEkBtojFtuABS4I=
X-Google-Smtp-Source: AA6agR7w3QLah3jvzgpP+U6S7uAAegNDrK3EcELvD/a6uUlQZDeDp017BuPJS5mQhkphlc1r6/mqog==
X-Received: by 2002:a02:6d24:0:b0:33f:7beb:6b1 with SMTP id
m36-20020a026d24000000b0033f7beb06b1mr3626659jac.86.1659729240127;
Fri, 05 Aug 2022 12:54:00 -0700 (PDT)
User-Agent: slrn/1.0.3 (Linux)
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: <62ed7557.050a0220.1d68f.2d24@mx.google.com>
X-Mailman-Original-References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me>
 by: Grant Edwards - Fri, 5 Aug 2022 19:53 UTC

On 2022-08-05, GB <NOTsomeone@microsoft.invalid> wrote:

>> BTW, there is an indentation error in your original post - line 5
>> should line up with line 4.
>
> As a Python beginner, I find that Python is annoyingly picky about
> indents. And, the significance of indents is a bit of a minefield for
> beginners.

As a C beginner, you'll find that C is annoyingly picky about curly
braces and semcolons.

All programming languages are picky about syntax.

> For example, in the above code, the indent of the final line very
> significantly affects the results:
>
> print(var)
> print(var)
> print(var)
>
> These are all different.

Indeed. It looks different, and it _is_ different. Seems like a good
thing to me. I like programs to do what it looks like they are going
to do.

In C, this doesn't do what it looks like it's supposed to do.

if (foo)
do_this();
and_this();
then_do_this();

Re: Trying to understand nested loops

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: mat...@wichmann.us (Mats Wichmann)
Newsgroups: comp.lang.python
Subject: Re: Trying to understand nested loops
Date: Fri, 5 Aug 2022 14:57:41 -0600
Lines: 33
Message-ID: <mailman.206.1659733073.20444.python-list@python.org>
References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me>
<8d988c61-c229-ff0d-7c0b-c3f7cc4c40b4@wichmann.us>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de +fswt1RbgBgr4xDxR2w+6AO40UWBZJzwmHMFsTdOqCCw==
Return-Path: <mats@wichmann.us>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="1024-bit key; unprotected key"
header.d=pobox.com header.i=@pobox.com header.b=tf1mgVWk;
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.048
X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'argument': 0.04;
'indicate': 0.05; 'beginner,': 0.07; 'later,': 0.09;
'subject:Trying': 0.09; 'affects': 0.16; 'beginners.': 0.16;
'improves': 0.16; 'indentation': 0.16; 'interpreter': 0.16;
'mean,': 0.16; 'meaningful,': 0.16; 'millman': 0.16;
'readability': 0.16; 'received:64.147': 0.16; 'subject:nested':
0.16; 'wrote:': 0.16; 'python': 0.16; 'to:addr:python-list': 0.20;
'language': 0.21; 'languages': 0.22; 'code': 0.23; 'bit': 0.27;
'example,': 0.28; 'error': 0.29; 'header:User-Agent:1': 0.30;
'code,': 0.31; 'there': 0.33; 'someone': 0.34; 'mean': 0.34;
'header:In-Reply-To:1': 0.34; 'yes,': 0.35; 'final': 0.35;
'months': 0.35; 'using': 0.37; "it's": 0.37; 'received:192.168':
0.37; 'way': 0.38; 'means': 0.38; 'use': 0.39; 'consistent': 0.40;
'should': 0.40; "there's": 0.61; 'above': 0.62; 'skip:\xc2 10':
0.62; 'clear': 0.64; 'requirement': 0.64; 'your': 0.64; 'look':
0.65; 'received:64': 0.67; 'and,': 0.69; 'trust': 0.71;
'8bit%:100': 0.76; 'choice': 0.76; 'editors': 0.76; 'extra': 0.84;
'happens': 0.84; 'characters': 0.84; "else's": 0.84; 'so:': 0.84;
'brain': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=message-id
:date:mime-version:subject:to:references:from:in-reply-to
:content-type:content-transfer-encoding; s=sasl; bh=ntpVDoECWmtV
vth9N3j/KIWucwa9srjnYr0SbjcX8lQ=; b=tf1mgVWkNWOlMuJrrUwxYs1Oyw5W
rds57Q88Uk6d//6FWyZ/Ao2rAJxBOMZ10T3SxDPQsOZdozNjED0W79ynfRspvIj1
J8IkLkGWKRiFczkY1GF4097jnr+ZmQkPsjOMDm7XaBX64xfBzWrwhrF2UpL+sqbF
RwLvaRhzc0gJA2U=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=wichmann.us;
h=message-id:date:mime-version:subject:to:references:from:in-reply-to:content-type:content-transfer-encoding;
s=2018-07.pbsmtp; bh=2Woj87mlHUjLe54fvcpRKwHWeRkPPu9l1qpv+AVUdQQ=;
b=faC22VmHyw6+ON9dv119CPttIdAK4MKGzyrWLPSfFtPL99R/iUOoZ0L2EbPBPOUH9neRzDw7+e4MnrJZgkVe5AbbSybosGLHl2tRL7cxnRElv/dvL74V4vjyv0omQwlchtE1RUOtn9wawesJlwNSTYQ6E/l3ZuAFy8gZ7MVcG9o=
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.12.0
Content-Language: en-US
In-Reply-To: <tcipgj$347ur$1@dont-email.me>
X-Pobox-Relay-ID: 3FCFD28C-1501-11ED-8769-5E84C8D8090B-81526775!pb-smtp1.pobox.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: <8d988c61-c229-ff0d-7c0b-c3f7cc4c40b4@wichmann.us>
X-Mailman-Original-References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me>
 by: Mats Wichmann - Fri, 5 Aug 2022 20:57 UTC

On 8/5/22 03:56, GB wrote:
> On 05/08/2022 08:56, Frank Millman wrote:
>
>> BTW, there is an indentation error in your original post - line 5
>> should line up with line 4.
>
> As a Python beginner, I find that Python is annoyingly picky about
> indents.  And, the significance of indents is a bit of a minefield for
> beginners.
>
> For example, in the above code, the indent of the final line very
> significantly affects the results:
>
> print(var)
>     print(var)
>         print(var)
>
> These are all different.

Yes, very picky. Python has chosen to use a (consistent) indent to
indicate a code block, as opposed to using extra syntactical characters
(curly braces, etc.) to delimit blocks. It's just a choice that was
made about how to instruct the interpreter what you mean, and there's
some argument that it improves readability later, when you go look at
your code months later, or someone else's code: the requirement to have
consistent indents means your brain can trust that the way the code is
indented is meaningful, rather than arbitrary. Also note that most
(all?) code formatters for other languages will enforce consistent
indenting too, In Python it just happens to be part of the language
rather than optional. So: you need to be clear about what you mean by
indenting correctly. All good code editors that understand Python
understand about this and will help you as much as they can.

RE: Trying to understand nested loops

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From:
Newsgroups: comp.lang.python
Subject: RE: Trying to understand nested loops
Date: Fri, 5 Aug 2022 19:41:59 -0400
Lines: 72
Message-ID: <mailman.209.1659742926.20444.python-list@python.org>
References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me>
<01f101d8a924$f4f71560$dee54020$@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de XaGp5gkf4I8CMJHH+i0j2gEa9veTT2bZ8PU3XtwKV2zQ==
Return-Path: <avi.e.gross@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=CHFXcmtF;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.006
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'poster': 0.03; 'this:':
0.03; 'learning.': 0.04; '2022': 0.05; 'beginner': 0.07;
'beginner,': 0.07; 'language,': 0.09; 'subject:Trying': 0.09;
'url:mailman': 0.15; 'affects': 0.16; 'beginners.': 0.16;
'generates': 0.16; 'indentation': 0.16; 'like.': 0.16; 'loops':
0.16; 'millman': 0.16; 'nested': 0.16; 'rules.': 0.16; 'stuck':
0.16; 'subject:nested': 0.16; 'syntaxerror:': 0.16; 'think.':
0.16; 'wrote:': 0.16; 'python': 0.16; 'instead': 0.17; 'message-
id:@gmail.com': 0.18; 'uses': 0.19; 'to:addr:python-list': 0.20;
'all,': 0.20; 'language': 0.21; 'doubt': 0.22; 'maybe': 0.22;
'version': 0.23; 'code': 0.23; 'skip:- 10': 0.25; 'url-
ip:188.166.95.178/32': 0.25; 'url-ip:188.166.95/24': 0.25;
'python,': 0.25; 'url:listinfo': 0.25; 'url-ip:188.166/16': 0.25;
'anyone': 0.25; 'friday,': 0.26; 'bit': 0.27; 'example,': 0.28;
'it,': 0.29; 'error': 0.29; 'whole': 0.30; 'code,': 0.31;
'received:209.85.160': 0.31; 'url-ip:188/8': 0.31; 'program':
0.31; 'python-list': 0.32; 'rapidly': 0.32; 'but': 0.32; 'there':
0.33; 'someone': 0.34; 'header:In-Reply-To:1': 0.34;
'received:google.com': 0.34; 'trying': 0.35; 'invalid': 0.35;
'final': 0.35; 'from:addr:gmail.com': 0.35; 'people': 0.36;
'received:209.85': 0.37; 'others': 0.37; 'way': 0.38;
'received:209': 0.39; 'least': 0.39; 'single': 0.39; 'text': 0.39;
'sending': 0.39; 'use': 0.39; 'received:100': 0.39; 'to.': 0.39;
'serious': 0.40; 'something': 0.40; 'want': 0.40; 'should': 0.40;
'in,': 0.60; 'likely': 0.61; 'stay': 0.61; 'above': 0.62; 'from:':
0.62; 'to:': 0.62; 'seen': 0.62; 'true': 0.63; 'email': 0.63;
'once': 0.63; 'our': 0.64; 're:': 0.64; 'speaking': 0.64; 'your':
0.64; 'decided': 0.67; 'now,': 0.67; 'body': 0.67; 'that,': 0.67;
'and,': 0.69; 'apply.': 0.69; 'responding': 0.69; 'rules': 0.70;
'sent:': 0.78; 'spent': 0.81; 'position': 0.81; 'errors,': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=content-language:thread-index:content-transfer-encoding
:mime-version:message-id:date:subject:in-reply-to:references:to:from
:from:to:cc; bh=5RYTn6RzLcRV6q9FrMTvtZ3cp+h0UwFHUfWdhHd/pqg=;
b=CHFXcmtFP2LXF9W1nW8lQd3kDkQztPqnofDqteMUpUR5kG0DHXyrTW+KJw0Md15Zrv
Q1MXtmi2paG8Fk8J/51AzJwadb+2IiO6TiKIDb/HbVdyLUpVNVSXLsjPGs9eQMGjPiSH
eJQH9TJ1Z+pSmH8CSc9hr9Z46VBZkiLPYWXCeS8/JSq93XKthOXnjGuP5dg75cTc+b9x
ipXxnAd5Vu1aXy/14U6Lx9nAW+OO6J+4a7y0GF1EQMcthYBlHKnalXbhiQ97tZZ8FvTO
8wjQlvD79InGheBNQyuc4KXvaB4Z14SEyuTShu4qIg0zUtUZQEop/Da9rypcDYfi8qPU
D87A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=content-language:thread-index:content-transfer-encoding
:mime-version:message-id:date:subject:in-reply-to:references:to:from
:x-gm-message-state:from:to:cc;
bh=5RYTn6RzLcRV6q9FrMTvtZ3cp+h0UwFHUfWdhHd/pqg=;
b=ApPAGLrh1aL7Ojt+WEaBING9SjSo6QVuV3vsz2NXQDJSHHpfR2nSQQRfB0seUHwhNB
sOkNLl9opLZpgoBJqA19I+JztPhRQUPd0Z6tXhmsrDIoLv4jPw2sV/BpZYRoYQhx8GBu
Jv3X7/VeV1y9yP5SsHxTb1wZrDzs5rNzfxX6WE589AqN36MRU4BIY/n6qq4IHekj3/T6
V6Uulj5yqJi563jRXNc0e+pgbA/b7mz/Wk3GRvWxaD7UiUPqwDLrX8Gt5WWS8jl49qUv
9TiALyRB51JqaAlLpaDLCWtH0I4Jyr+oIFEcNo7kmWHQtRjjT6D1rGytZxAG4gS+cf7U
hkIA==
X-Gm-Message-State: ACgBeo174nDhJVHoO3Ovldz30W2xReSRrSbkaZ1O2YnjDVyVBzf9nubc
SeRxGw7g1pVh4C9cAAb6ah28gYRhqTw=
X-Google-Smtp-Source: AA6agR717UYfTMnnX23zl0QMery18ojVOmI8/IOjEhrzouIlNoZJ99qie5YoyY5b/3SDLPopfKXUkw==
X-Received: by 2002:a05:622a:44:b0:31e:d448:8746 with SMTP id
y4-20020a05622a004400b0031ed4488746mr7930418qtw.664.1659742923299;
Fri, 05 Aug 2022 16:42:03 -0700 (PDT)
In-Reply-To: <tcipgj$347ur$1@dont-email.me>
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQOESmWI9HetpIWV3ULA9SG/jzxu8wKS14HYArTzlDwCcdXNs6oL5LUQ
Content-Language: en-us
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: <01f101d8a924$f4f71560$dee54020$@gmail.com>
X-Mailman-Original-References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me>
 by: - Fri, 5 Aug 2022 23:41 UTC

I wonder if someone is pulling our leg as they are sending from an invalid
email address of "GB <NOTsomeone@microsoft.invalid>" which is a bit sick.

I have trouble imagining ANYONE learning a language like python without
rapidly being told that python uses indentation instead of various ways to
detect when a body of text is considered a single composite item.

And code like their example is also nonsense:

print(var)
print(var)
print(var)

On my version of python, and likely most or all, it generates an error
message like:

SyntaxError: multiple statements found while compiling a single
statement

The way I see it, it is beyond irrelevant when learning a language what YOU
(the learner) think. The rules are the rules. If you do not like them and do
not have to use that language, go find another you might like.

If you want to stay with the language, you not only adjust but welcome new
ways of doing things. I have seen people stuck on code like this:

a, b, c = 5,4,3

others get nauseous at something like:

a, b, _ = some_func(args)

But the whole point is learning to appreciate what someone decided might
make the language more useful, easier to program in, avoid errors, be more
flexible, or maybe more efficient, or whatever design criteria apply. Only
once you understand more things like that, can you be in a position to
critique it as horrible.

So, speaking for myself, the poster is assumed, for now, to not be worth
responding to. I doubt they are a true beginner or at least that they have
spent any serious time learning.

-----Original Message-----
From: Python-list <python-list-bounces+avi.e.gross=gmail.com@python.org> On
Behalf Of GB
Sent: Friday, August 5, 2022 5:57 AM
To: python-list@python.org
Subject: Re: Trying to understand nested loops

On 05/08/2022 08:56, Frank Millman wrote:

> BTW, there is an indentation error in your original post - line 5
> should line up with line 4.

As a Python beginner, I find that Python is annoyingly picky about indents.
And, the significance of indents is a bit of a minefield for beginners.

For example, in the above code, the indent of the final line very
significantly affects the results:

print(var)
print(var)
print(var)

These are all different.

--
https://mail.python.org/mailman/listinfo/python-list

Re: Trying to understand nested loops

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: drsali...@gmail.com (Dan Stromberg)
Newsgroups: comp.lang.python
Subject: Re: Trying to understand nested loops
Date: Fri, 5 Aug 2022 16:55:18 -0700
Lines: 17
Message-ID: <mailman.210.1659743732.20444.python-list@python.org>
References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me>
<CAGGBd_p5g0FbvCFABX_5GBBGeaRUUcn6KCofiYLqgvTbGxk6vg@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de CwZbXKNdXPCntcTdFAnpXwZetHEQ6nnt9ujA61kjIU5g==
Return-Path: <drsalists@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=ZOSgXE8/;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.003
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '2022': 0.05; 'aug': 0.07;
'beginner,': 0.07; 'cc:addr:python-list': 0.09; 'subject:Trying':
0.09; '&gt;': 0.14; 'anyway.': 0.16; 'beginners.': 0.16;
'cc:name:python list': 0.16; 'from:addr:drsalists': 0.16;
'from:name:dan stromberg': 0.16; 'indentation': 0.16; 'millman':
0.16; 'subject:nested': 0.16; 'wrote:': 0.16; 'python': 0.16;
'cc:addr:python.org': 0.20; 'fri,': 0.22; 'cc:2**0': 0.25; 'bit':
0.27; 'error': 0.29; 'message-id:@mail.gmail.com': 0.32; 'there':
0.33; 'header:In-Reply-To:1': 0.34; 'received:google.com': 0.34;
'from:addr:gmail.com': 0.35; 'received:209.85': 0.37;
'received:209': 0.39; 'received:209.85.208': 0.39; 'should': 0.40;
'about.': 0.64; 'your': 0.64; 'and,': 0.69; 'reduces': 0.84;
'worry': 0.95
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to
:cc; bh=SnYI7qFRLuZcH33oZ1h4uucBK4ibq0efTfS66dJq6T8=;
b=ZOSgXE8/vS1ItVmVx++4fN11q/9XFwrJXqXXpU2u9SSudsrdOKLC5JVur9B5B1ri0p
xZOUqre3GfO5gzSkMUb8ATUZTRTo3Vusg3VHJg7o/NL1/2JCbyJus6rF5tno9L6I9wMu
uJ5IjAhDXYJx1heTgIIONIn6DYP71lsgEvPf22E3R36j0gXG1qykkUFWVPjrLdpDSRTg
XXAHMdo1ZoTQ+XPmFJp9103SxxcI7iymIGBV5UuoadiQORzNBXwHDfAn9Hi36Ow8ZEtO
c1/UPRv7goy37TJe1AJRgcFrbu10Dwt71K62xEaf/GeqPjNR+BtxjF6FtabREktsnMBA
VJ7w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to:cc;
bh=SnYI7qFRLuZcH33oZ1h4uucBK4ibq0efTfS66dJq6T8=;
b=nKbs+lX+5wKUSxmHPZcJkcPwbzVLXJ2HSz+zCjwy00XrOC/xhhvDDracjHHtccXvQW
7RdWs3EjveBmLCwm6GtMGohDhf7iqRj/NSrdu0QWNysF9QwkQOdvDWG4+Wpt0w0OB/pS
AaAw2OnhXOhpmtUoWqUIIocgiKvFnICZYGqOkXvvewx7XipLY7CkxByB4kgM4yU4SoLv
cPBNvOzeu1d411+qABn+0RZJMMM/Cp4s8UINRgTfX7ru5HG3cRt0BCL8Ooe5TyJdekXQ
WUeE+hZnD6soQaj9Ueg+92klYLDW5iaBwAjVUDYkntv4Rw5ctEiK2vENNM7LlxMv1+xB
ODLg==
X-Gm-Message-State: ACgBeo2MS2mqYWsdsp/N2lRpml6+G9Phq2M1/VkqSbMBRMqzwVb+pGoZ
ZdN/P1ouKxuQnGJiJm96nMIVdjdRz4WkM5slRVLNbh6ksWg=
X-Google-Smtp-Source: AA6agR5jQGj7sBXURUmjwsInEhoayvh4EaPwPbbiUP0fNNd/LjBJMdIGlkoM7xHua1mI3QU1+8dFOlEzfc9boWKREHg=
X-Received: by 2002:a2e:a99b:0:b0:25e:be66:72f2 with SMTP id
x27-20020a2ea99b000000b0025ebe6672f2mr718054ljq.27.1659743730807; Fri, 05 Aug
2022 16:55:30 -0700 (PDT)
In-Reply-To: <tcipgj$347ur$1@dont-email.me>
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
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: <CAGGBd_p5g0FbvCFABX_5GBBGeaRUUcn6KCofiYLqgvTbGxk6vg@mail.gmail.com>
X-Mailman-Original-References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me>
 by: Dan Stromberg - Fri, 5 Aug 2022 23:55 UTC

On Fri, Aug 5, 2022 at 12:30 PM GB <NOTsomeone@microsoft.invalid> wrote:

> On 05/08/2022 08:56, Frank Millman wrote:
>
> > BTW, there is an indentation error in your original post - line 5 should
> > line up with line 4.
>
> As a Python beginner, I find that Python is annoyingly picky about
> indents. And, the significance of indents is a bit of a minefield for
> beginners.
>
No, you should indent properly anyway. Python just reduces the number of
things to worry about.

Please see:
https://stromberg.dnsalias.org/~strombrg/significant-whitespace.html
....for the usual.

Re: Trying to understand nested loops

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

  copy mid

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

  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: Trying to understand nested loops
Date: Sat, 6 Aug 2022 11:57:30 +1200
Organization: DWM
Lines: 28
Message-ID: <mailman.211.1659743861.20444.python-list@python.org>
References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me> <01f101d8a924$f4f71560$dee54020$@gmail.com>
<e5d45e7f-9213-dc31-3bd9-cc6f78a879c3@DancesWithMice.info>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de rAmN8UvNblFu/+zMmXGYNw4gwXY9edsXfLNdOPAOxgwA==
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=mJA6kxDf; dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.008
X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; '=dn': 0.09;
'from:addr:danceswithmice.info': 0.09; 'from:addr:pythonlist':
0.09; 'subject:Trying': 0.09; 'folk': 0.16; 'indentation': 0.16;
'message-id:@DancesWithMice.info': 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;
'subject:nested': 0.16; 'wrote:': 0.16; 'python': 0.16; 'instead':
0.17; 'uses': 0.19; 'addresses': 0.19; 'to:addr:python-list':
0.20; 'language': 0.21; 'written': 0.22; 'code': 0.23; 'anyone':
0.25; 'bit': 0.27; 'header:User-Agent:1': 0.30;
'header:Organization:1': 0.31; 'rapidly': 0.32; 'there': 0.33;
'someone': 0.34; 'header:In-Reply-To:1': 0.34; 'invalid': 0.35;
'final': 0.35; 'author': 0.37; 'received:192.168': 0.37; 'way':
0.38; 'could': 0.38; 'single': 0.39; 'text': 0.39; 'sending':
0.39; 'use': 0.39; 'email addr:gmail.com': 0.63; 'email': 0.63;
'our': 0.64; 'received:51': 0.64; 'thus': 0.64; 'look': 0.65;
'body': 0.67; 'matter': 0.68
DKIM-Filter: OpenDKIM Filter v2.11.0 vps.rangi.cloud 5516F5ADD
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=danceswithmice.info;
s=staff; t=1659743859;
bh=aHidnJGJGRjb3i8jKH7/jNp85mEmc2V6EaWkXWW8ezM=;
h=Date:Subject:To:References:From:In-Reply-To:From;
b=mJA6kxDfF2z+UsbhukojQcGT6jdpv66B6IYk4ykF+lXi/Gpabex0IsqPuh/azPsM4
vnG0rHhCpi71vHig7XviBdbQgBTh9RC9vVqg0UqMMq5FTsgYHeKLoDrgQfzgUwcw4M
J9SQJ70+mcRVTwP27TUocNYH64XiIS6uZX3uZzrbEjqLers/TB2ZAFaiBO0+QGWtWy
xo32+Ki5oqjPOW14+XQfxKgCwvK/ZnhLEafbTNGuluUsuPOvQ9T736PNGwzUp5+SmH
VZrw3MIH1TjY4F+9wdzVytNbmYag/MGWIOGDnz4mpPrPS7KvKU5xwmIZT1zS+BWyV2
oSm2d7Q/ZTttw==
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Content-Language: en-GB
In-Reply-To: <01f101d8a924$f4f71560$dee54020$@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: <e5d45e7f-9213-dc31-3bd9-cc6f78a879c3@DancesWithMice.info>
X-Mailman-Original-References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me> <01f101d8a924$f4f71560$dee54020$@gmail.com>
 by: dn - Fri, 5 Aug 2022 23:57 UTC

On 06/08/2022 11.41, avi.e.gross@gmail.com wrote:
> I wonder if someone is pulling our leg as they are sending from an invalid
> email address of "GB <NOTsomeone@microsoft.invalid>" which is a bit sick.

There are a number of folk who use evidently false email addresses - the
OP's had me amused.

Such 'hiding' is a matter for the List-Admins (thanks for all the work
exerted on our behalf!) and how it fits with the Code-of-Conduct.

> I have trouble imagining ANYONE learning a language like python without
> rapidly being told that python uses indentation instead of various ways to
> detect when a body of text is considered a single composite item.
>
> And code like their example is also nonsense:
>
> print(var)
> print(var)
> print(var)

Another way to look at that post, and what the author may have meant; is
that the final print(), incorrectly indented in the OP, could have been
written with three different indentations, and thus have three very
different effects (cf that they are all to be used, as-is).
--
Regards,
=dn

RE: Trying to understand nested loops

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From:
Newsgroups: comp.lang.python
Subject: RE: Trying to understand nested loops
Date: Fri, 5 Aug 2022 20:28:31 -0400
Lines: 116
Message-ID: <mailman.212.1659745717.20444.python-list@python.org>
References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me> <01f101d8a924$f4f71560$dee54020$@gmail.com>
<e5d45e7f-9213-dc31-3bd9-cc6f78a879c3@DancesWithMice.info>
<01f901d8a92b$750bb8e0$5f232aa0$@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de ZC9wwiZ0EEulyt4HnFb3WgT+efEfg/GMLjUCEHpEt44g==
Return-Path: <avi.e.gross@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=EuAdJTs5;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.027
X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'this:': 0.03; 'argument':
0.04; '(for': 0.05; '2022': 0.05; 'suggestion': 0.07; 'wanting':
0.07; '=dn': 0.09; 'aligned': 0.09; 'const': 0.09; 'meant': 0.09;
'subject:Trying': 0.09; 'url:mailman': 0.15; '(more': 0.16;
'applies': 0.16; 'arguments': 0.16; 'avi': 0.16; 'folk': 0.16;
'indeed': 0.16; 'indentation': 0.16; 'loops': 0.16; 'nested':
0.16; 'posters': 0.16; 'received:209.85.160.173': 0.16; 'received
:mail-qt1-f173.google.com': 0.16; 'somewhat': 0.16; 'spot': 0.16;
'subject:nested': 0.16; 'things,': 0.16; 'which,': 0.16; 'wrote:':
0.16; 'python': 0.16; 'instead': 0.17; 'message-id:@gmail.com':
0.18; 'uses': 0.19; 'addresses': 0.19; 'calls': 0.19; 'to:addr
:python-list': 0.20; 'language': 0.21; 'written': 0.22; 'code':
0.23; 'lines': 0.23; 'skip:- 10': 0.25; 'url-
ip:188.166.95.178/32': 0.25; 'url-ip:188.166.95/24': 0.25;
'url:listinfo': 0.25; 'url-ip:188.166/16': 0.25; 'anyone': 0.25;
'seems': 0.26; 'do,': 0.26; 'friday,': 0.26; 'else': 0.27; 'bit':
0.27; 'function': 0.27; 'sense': 0.28; 'goes': 0.28; 'suggest':
0.28; 'wrong': 0.28; 'takes': 0.31; 'received:209.85.160': 0.31;
'url-ip:188/8': 0.31; 'think': 0.32; 'assume': 0.32; 'python-
list': 0.32; 'rapidly': 0.32; 'but': 0.32; 'mailing': 0.33;
'there': 0.33; 'particular': 0.33; 'someone': 0.34; 'same': 0.34;
'mean': 0.34; 'header:In-Reply-To:1': 0.34; 'received:google.com':
0.34; 'trying': 0.35; 'invalid': 0.35; 'meaning': 0.35;
'following': 0.35; 'final': 0.35; 'from:addr:gmail.com': 0.35;
'functions': 0.36; 'posts': 0.36; 'people': 0.36; 'those': 0.36;
'lists': 0.37; 'using': 0.37; 'received:209.85': 0.37; 'author':
0.37; 'hard': 0.37; 'others': 0.37; 'way': 0.38; 'could': 0.38;
'put': 0.38; 'received:209': 0.39; 'least': 0.39; 'single': 0.39;
'text': 0.39; 'sending': 0.39; 'use': 0.39; 'block': 0.39;
'received:100': 0.39; 'exact': 0.40; 'place.': 0.40; 'wants':
0.40; 'something': 0.40; 'should': 0.40; 'tell': 0.60; 'best':
0.61; 'above': 0.62; 'from:': 0.62; 'to:': 0.62; 'seen': 0.62;
'format': 0.62; 'reasonable': 0.62; 'here': 0.62; 'email
addr:gmail.com': 0.63; 'simply': 0.63; 'email': 0.63; 'between':
0.63; 'skip:b 10': 0.63; 'our': 0.64; 'becomes': 0.64;
'explained': 0.64; 'overall': 0.64; 're:': 0.64; 'thus': 0.64;
'your': 0.64; 'look': 0.65; 'body': 0.67; 'that,': 0.67; 'matter':
0.68; 'apply.': 0.69; 'perfectly': 0.69; 'result,': 0.69; 'rules':
0.70; 'ignore': 0.71; 'longer': 0.71; 'deal': 0.73; 'watch': 0.76;
'ranging': 0.76; 'sent:': 0.78; 'placement': 0.81; 'waste': 0.81;
'left': 0.83; 'guy': 0.84; 'elsewhere.': 0.84; 'remind': 0.84;
'rules,': 0.84; 'articles': 0.86; 'deliberately': 0.91;
'mistakes': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=content-language:thread-index:content-transfer-encoding
:mime-version:message-id:date:subject:in-reply-to:references:to:from
:from:to:cc; bh=ARNSg7uqIVxynWePPPUJ74RZGqWYfcj21Yvun4+rHLU=;
b=EuAdJTs5y/jXtymROwaHycsd4iM5wni8isswOvMGLu4AAXuz3yt9GJZoaCaalUvpf9
Qfbnt8i2DD1BvPpbQBVwl4e4ScUE9WBcRz91rhkrLhiVO6nrI96KkNZ7rA30TI92/6uX
0QqgC7XWujOi74HaUatJUEeWehYN8pkJ86c3AsscP7M+DGgI9WmBaIrJbulMF/gMU07Z
cIkk4yHBnibrwC+EGJ8gRENNDaunmzbfz+VafxQ+tl16ryI8G5+gvi9ZQYYBxfGhM5Yp
59RgeI3zLrH5nuEng3SgaLtJwaKgKx53CUNmqTi5MYEAZ+6kyCzI0a90nXJzKWhJG0XY
ESwg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=content-language:thread-index:content-transfer-encoding
:mime-version:message-id:date:subject:in-reply-to:references:to:from
:x-gm-message-state:from:to:cc;
bh=ARNSg7uqIVxynWePPPUJ74RZGqWYfcj21Yvun4+rHLU=;
b=Nh1o6fhB/o6jzq21L/HVzinXwUeiSBnW1zuK58JnDfOTbH6aW5lgXJh8gljdTa4MRG
tppXavjFiZk1q4Z9Cw9l2C7I6nUtYAyEAzlb3+wKtFJxa4yqMMUm/LjQ+BA9MC/4xXBJ
kaZKFweQG5J3XwNleV4wtzqLxT2qEGoIF7lf3QNtJ+awdKEpPQ2qAoka+VPMiDFkwbCo
aEO9MvZzZic59lC9OoGjEcUEz9DPmir76z1b7h4hLuqCRPv1yNMFfLZGhbWJyfDGULH2
SsonQWqrwNI8pzpVuVmcEmHgo2Vd74Tz0truMpkhrhIGikEBNyHSdvMFqp7E8LsIWaIA
j/iw==
X-Gm-Message-State: ACgBeo3akRCE092sayV4aXp2YvDZcs6PDo9m1NgkFvZyR2gzvgwslgE1
NoGRMTkmiyskWmE5oQyzz51D6Qi8Ckk=
X-Google-Smtp-Source: AA6agR4S868mredcduXupBSlIC7Ulsk9YZXQXR9wVpZTrgQXZierO/i2LHYZqZBl+pO7252Kn4600g==
X-Received: by 2002:ac8:5703:0:b0:31e:f79b:9ecc with SMTP id
3-20020ac85703000000b0031ef79b9eccmr7755652qtw.192.1659745715236;
Fri, 05 Aug 2022 17:28:35 -0700 (PDT)
In-Reply-To: <e5d45e7f-9213-dc31-3bd9-cc6f78a879c3@DancesWithMice.info>
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQOESmWI9HetpIWV3ULA9SG/jzxu8wKS14HYArTzlDwCcdXNswJjDKWuAb7tPEKp6t8UEA==
Content-Language: en-us
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: <01f901d8a92b$750bb8e0$5f232aa0$@gmail.com>
X-Mailman-Original-References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me> <01f101d8a924$f4f71560$dee54020$@gmail.com>
<e5d45e7f-9213-dc31-3bd9-cc6f78a879c3@DancesWithMice.info>
 by: - Sat, 6 Aug 2022 00:28 UTC

I had considered that, Dave. Albeit others did at least put in some
three-dot markers to show there was other code between the three lines
shown.

But the same silly argument they used applies elsewhere. Consider nested
calls like:

Delta(Gamma(Beta(Alpha)))

Now say one of those functions takes an argument like 666.

The following lines all mean different things, especially if all the above
functions can take an optional argument of 666.

Delta(Gamma(Beta(Alpha,666)))
Delta(Gamma(Beta(Alpha),666))
Delta(Gamma(Beta(Alpha)),666)
Delta(666,Gamma(Beta(Alpha)))
Delta(Gamma(666,Beta(Alpha)))
Delta(Gamma(Beta(666,Alpha)))

And of course any such function calls may be in contexts such as this:

Result, const = Delta(Gamma(Beta(Alpha))),666

My point is that whether using indentation or parentheses or braces or other
grouping techniques, exact placement according to the rules must apply. I
often write code where I use indentation to remind ME which argument goes
with which, such as this (more often not in python where indentation has no
real meaning and things can span multiple lines.

This:

Delta(Gamma(666,Beta(Alpha)))

May make more sense to write like this:

Delta(Gamma(666,
Beta(Alpha)))

Or in a more general case where each of the functions may take multiple
arguments before and/or after nested, calls, I might have a long convoluted
code where all arguments to a particular function are vertically aligned and
it is easier to spot if you left one out or put it in the wrong place.

It becomes a somewhat childish argument when writing CODE in any language
with rules, to suggest that it should ignore your mistakes and assume you
meant to have a comma here or parentheses there and similarly, that the
indentation level should govern which block your print statement is part of.

Hence my suggestion that perhaps someone is in a sense punking us

Of course it is perfectly possible the software this person is using makes
that deliberately unworkable email address as I have seen this elsewhere. It
just raises my suspicion level when I have seen other posts on various
mailing lists ranging from someone with pretty much no knowledge about a
topic but wanting someone to do their homework, to someone who throws in
something (perhaps incendiary) to watch others waste their time trying to
deal with their best guesses of what was wanted, to one guy who seems to
write articles or books and wants to see what people think but then does not
participate or tell us that is what they wanted.

My point was not to tell anyone else here what to do, simply that I will be
cautious with such posters as I have way better things to do!

Nested loops are indeed a hard topic for many. But when explained it no
longer seems reasonable to ask why print statements at different levels of
nesting differ.

Not to me, at least.

- Avi (for those like someone on another language/group who did not know how
to address me in overall too-polite format and referred to me as "Dear
" followed by more lines.

-----Original Message-----
From: Python-list <python-list-bounces+avi.e.gross=gmail.com@python.org> On
Behalf Of dn
Sent: Friday, August 5, 2022 7:58 PM
To: python-list@python.org
Subject: Re: Trying to understand nested loops

On 06/08/2022 11.41, avi.e.gross@gmail.com wrote:
> I wonder if someone is pulling our leg as they are sending from an
> invalid email address of "GB <NOTsomeone@microsoft.invalid>" which is a
bit sick.

There are a number of folk who use evidently false email addresses - the
OP's had me amused.

Such 'hiding' is a matter for the List-Admins (thanks for all the work
exerted on our behalf!) and how it fits with the Code-of-Conduct.

> I have trouble imagining ANYONE learning a language like python
> without rapidly being told that python uses indentation instead of
> various ways to detect when a body of text is considered a single
composite item.
>
> And code like their example is also nonsense:
>
> print(var)
> print(var)
> print(var)

Another way to look at that post, and what the author may have meant; is
that the final print(), incorrectly indented in the OP, could have been
written with three different indentations, and thus have three very
different effects (cf that they are all to be used, as-is).
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list

Re: Trying to understand nested loops

<tckmg1$148n$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!aioe.org!mobONL+5qvJuR/BTOUyGsw.user.46.165.242.75.POSTED!not-for-mail
From: mgog...@yahoo.com (Mladen Gogala)
Newsgroups: comp.lang.python
Subject: Re: Trying to understand nested loops
Date: Sat, 6 Aug 2022 03:17:21 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tckmg1$148n$1@gioia.aioe.org>
References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="37143"; posting-host="mobONL+5qvJuR/BTOUyGsw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Pan/0.149 (Bellevue; 4c157ba git@gitlab.gnome.org:GNOME/pan.git)
X-Notice: Filtered by postfilter v. 0.9.2
 by: Mladen Gogala - Sat, 6 Aug 2022 03:17 UTC

On Fri, 5 Aug 2022 10:56:34 +0100, GB wrote:

> As a Python beginner, I find that Python is annoyingly picky about
> indents. And, the significance of indents is a bit of a minefield for
> beginners.

That reminds me of my youth, when I was doing another language where indentation
was important. The language name was COBOL, which stands for "Completely Outdated
Badly Overused Language". COBOL was (and still is) a beauty, especially with the
addition of CICS and DL/1.
Python is, in some spiritual sense, a scripting successor to COBOL. Some hippies at
Bell Labs, I believe that the names are Thompson, Kernighan and Ritchie, came up
with enclosing blocks of statements to be executed together within curly braces.
Those hippies did it precisely to avoid messing up the indentation, as it used to
happen far too often in the first procedural languages like Fortran, PL/1 and COBOL.
However, the pure nostalgia brought the indentation back, in the big way. That is
one of the reasons why democracy isn't a perfect system, as was well known to our
founding fathers. Simple majority rule can sometimes ruin a good thing and make
things worse for everyone. Welcome to Python, scripting language accepted by the
vast majority of scripters.
The main virtue of Python is that it is consistently object oriented. However,
object orientation itself is a disaster of biblical proportions:

https://developers.slashdot.org/story/19/07/22/0426201/is-object-oriented-programming-a-trillion-dollar-disaster
https://betterprogramming.pub/object-oriented-programming-the-trillion-dollar-disaster-92a4b666c7c7

So, we have the programming language which claims a consistent implementation of a
very suspect programming methodology at best as its main advantage. And true to the
form, the indentation is back. Python should be renamed to "Critical Programming
Theory".

PS:
I was forced to learn Python by the manager who said "we don't do Perl in this company".
Since scripting is an unavoidable part of the DBA job, I had to learn the COBOL of the
scripting languages. One can only hope that the messiah will return and make the curly
braces popular again. Until then I too will be suffering under the yolk of the Guido van
Rossum's monstrosity.

--
Mladen Gogala
Database Consultant
https://dbwhisperer.wordpress.com

Re: Trying to understand nested loops

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.mixmin.net!news2.arglkargh.de!news.karotte.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: drsali...@gmail.com (Dan Stromberg)
Newsgroups: comp.lang.python
Subject: Re: Trying to understand nested loops
Date: Fri, 5 Aug 2022 20:53:03 -0700
Lines: 13
Message-ID: <mailman.213.1659757998.20444.python-list@python.org>
References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me> <62ed7557.050a0220.1d68f.2d24@mx.google.com>
<CAGGBd_qiuEqy8-rpGzN05ZfpspCQ+XVmvim4=Hso8Ti_zVAmxA@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de HD196Dr0GbXu2FJ9dVWy3QG4Qc7VAJo+UPbIzeiEqSWQ==
Return-Path: <drsalists@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=UJWzzNh1;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.007
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'looks': 0.02; '2022':
0.05; 'aug': 0.07; 'url:02': 0.07; 'cc:addr:python-list': 0.09;
'compiler': 0.09; 'subject:Trying': 0.09; 'cc:name:python list':
0.16; 'from:addr:drsalists': 0.16; 'from:name:dan stromberg':
0.16; 'subject:nested': 0.16; 'wrote:': 0.16; 'grant': 0.17;
'cc:addr:python.org': 0.20; 'fri,': 0.22; 'past': 0.25; 'cc:2**0':
0.25; 'think': 0.32; "doesn't": 0.32; 'do.': 0.32; 'message-
id:@mail.gmail.com': 0.32; 'but': 0.32; 'url:blog': 0.33; 'header
:In-Reply-To:1': 0.34; 'received:google.com': 0.34;
'from:addr:gmail.com': 0.35; "it's": 0.37; 'received:209.85':
0.37; 'received:209': 0.39; 'quite': 0.39; 'skip:\xc2 10': 0.62;
'right': 0.68; 'url-ip:lookup error': 0.70; 'url:2016': 0.70;
'url-ip:104.110.240/24': 0.75; 'url-ip:104.110/16': 0.75;
'supposed': 0.76; 'url:26': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to
:cc; bh=39B1UoGAL36fZPlkKWvTzhAE1qhJEudb0YnoJskHjJM=;
b=UJWzzNh1TtJzult5BDQFXPKNiFcsgwQUUZePnNZkfe4RrGUOC5PA2vVE96dGIeSiaw
Bn22rj3DDtRA4qPWsGOgWmloJut2xDQQqM6Cg+xfe4tqNL8PKmgzb4LoFTYDk1KbLI6j
WD3eA69fTjpDycMYcx6NDvwTj/ON184e+wH2gE/fTzJ/vhYyLDWmkAnLmj1EjqoORuEB
DAowIXfNYWDxP9jYGn5wQSx4icuvYyj2y4vK5VhZfcc4AvWHy4R2w+oKs1BqFh3Wz4BG
F9grfqY6E7T+4LvGLLKkfaYuCy8cOO2FjO05PBsul5SCCZWOAgZXkAIOkzMLZuHBpAX1
3OWA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to:cc;
bh=39B1UoGAL36fZPlkKWvTzhAE1qhJEudb0YnoJskHjJM=;
b=JjCTO03smNjUeWBNsOcQ9bLIcGizyLbwaLX/AE6mw3GOUl6ytlkDA5tk08oJqRgT4H
kHtWgMOkcOHlolTVDXRrl7SKWXtCaVQ6UNyIvQrQuoJD65ef8W/QUXCxDUpyLa+7J/tQ
N3gGrhuUb9yrN/rQ+dPiKnj8nhoo/BlbSpq//BYPaBRX4lJ46SzPEZXBrBWvTax4SThY
2JZekZcN9JNd8UBISBm1fGPJVI97qpI7XlABvDxTcNaHdKfXUW8EUB7SlfYSaeS1bBCb
UpOe3OMeJiDskLZgEkQzzl6DwDOj9NBLEww/zj3LORdMc8fx09uqjLvtNug92QVuPY11
oEmg==
X-Gm-Message-State: ACgBeo0kNgHGWG9a188Qoyd8MNjUBuMXYHLiDfD0ICirBvn118G7j2D+
hOWXy/XMNmCnKSdvXQtFIAw4ctcCFarfMPDqxefliweQzLg=
X-Google-Smtp-Source: AA6agR7xKNHpTsJXQ1soNgVPrk5Zds4Pm5RCQJCeIDDzDLwHJxWU04FNr22Sd486Z9E+OBI0Q8TlGUWPDCDr0nDohNs=
X-Received: by 2002:a05:6512:3f8e:b0:48a:4343:8265 with SMTP id
x14-20020a0565123f8e00b0048a43438265mr3134641lfa.294.1659757995965; Fri, 05
Aug 2022 20:53:15 -0700 (PDT)
In-Reply-To: <62ed7557.050a0220.1d68f.2d24@mx.google.com>
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
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: <CAGGBd_qiuEqy8-rpGzN05ZfpspCQ+XVmvim4=Hso8Ti_zVAmxA@mail.gmail.com>
X-Mailman-Original-References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me> <62ed7557.050a0220.1d68f.2d24@mx.google.com>
 by: Dan Stromberg - Sat, 6 Aug 2022 03:53 UTC

On Fri, Aug 5, 2022 at 12:54 PM Grant Edwards <grant.b.edwards@gmail.com>
wrote:

> In C, this doesn't do what it looks like it's supposed to do.
>
> if (foo)
> do_this();
> and_this();
> then_do_this();
>
It's been quite a while since I used C, but with the right compiler
flag(s), I think this may be a thing of the past when compiling with gcc:
https://developers.redhat.com/blog/2016/02/26/gcc-6-wmisleading-indentation-vs-goto-fail

Re: Trying to understand nested loops

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.mixmin.net!news2.arglkargh.de!news.karotte.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: ros...@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: Trying to understand nested loops
Date: Sat, 6 Aug 2022 14:01:13 +1000
Lines: 26
Message-ID: <mailman.214.1659758487.20444.python-list@python.org>
References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me> <62ed7557.050a0220.1d68f.2d24@mx.google.com>
<CAGGBd_qiuEqy8-rpGzN05ZfpspCQ+XVmvim4=Hso8Ti_zVAmxA@mail.gmail.com>
<CAPTjJmr0Qd0Aj-3HF65-WoNFb5O9D7F05oC0Me8ORb0RxyqPng@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de EaXq5mtIWnAjQd8kR5FMMw6Qs6zc796rYF70m8RF3WoQ==
Return-Path: <rosuav@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=jzO8PKAD;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.002
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'looks': 0.02; 'project,':
0.03; '2022': 0.05; 'aug': 0.07; 'url:02': 0.07; 'compiler': 0.09;
'dan': 0.09; 'open-source': 0.09; 'subject:Trying': 0.09;
'chrisa': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris
angelico': 0.16; 'interesting,': 0.16; 'reason.': 0.16;
'received:209.85.218': 0.16; 'subject:nested': 0.16; 'useless':
0.16; 'wrote:': 0.16; 'grant': 0.17; "can't": 0.17; 'to:addr
:python-list': 0.20; 'fri,': 0.22; 'sat,': 0.22; 'anything': 0.25;
'past': 0.25; 'done': 0.28; 'think': 0.32; "doesn't": 0.32; 'do.':
0.32; 'message-id:@mail.gmail.com': 0.32; 'but': 0.32; 'url:blog':
0.33; 'same': 0.34; 'header:In-Reply-To:1': 0.34;
'received:google.com': 0.34; 'yes,': 0.35; 'from:addr:gmail.com':
0.35; 'using': 0.37; "it's": 0.37; 'received:209.85': 0.37;
'received:209': 0.39; 'quite': 0.39; 'ever': 0.63; 'right': 0.68;
'acted': 0.69; 'url:2016': 0.70; 'url-ip:104.110.240/24': 0.75;
'url-ip:104.110/16': 0.75; 'supposed': 0.76; "team's": 0.84;
'url:26': 0.84; 'warning': 0.84; 'viewed': 0.93
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:from:to:cc; bh=qOcIP1mKmzmEnGCN1QA0bh0QDgBcOnP4L26MzRAoTZ4=;
b=jzO8PKADXlhWdBzDwqgGZRo6GJsKiCQ3P/qBfl5hJ92LFhZumZ9X0vXnSqrufSWzrY
6E3tn5L2OwErbI9S0/PBsCaC1hXH0UKsxkUo/KgPquYPmfsHfQrxcSVTs2wU9DqqlRMn
gQKywAsakPXzOBTojfsaAtE242BY8fDCcDi0cOKIs6ohAsI5HZ/vZIOzBCFVAlrh0oQB
BPBNW5HDRCvx0pjG1QGGUWwkCJ42PCPsIIPAGQYJ7ZQCeyg/qBe7kBZ0P4/A7d8TYI0B
rK4Ijhs1+KdAj+jEBHSWQVMUwyhQPaanohThW9uKgbk2fWH3wASACMPSWBbe89n1Z+MD
6j0Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:x-gm-message-state:from:to:cc;
bh=qOcIP1mKmzmEnGCN1QA0bh0QDgBcOnP4L26MzRAoTZ4=;
b=1wTOs44Jtglhncig/MgaAFD+44Th8T9yv7XsY5BE8DC+rBqyTBqylu1npjZR22cu9W
zwPjO7P+o9I6YN83beiCXjRw4c2vIbMLFN+Ln1UecJ57vt7AXDZP4ph8VJUgsD2TqAQu
FkkgGXE1at4yhrfugHv1Ff5r4qmv6lS9CVtZd3TxpsRSvAjxZ5IBrQ/7xaUWcqDGH+l8
f9JbIVT9rMJxchTd8A+2/s1xZCdTdGtv8/qBoYUPHQSCsLWte4kzsMPOeZ00QuVsEApI
a+UZNcdxJ2MDDw9JHP5U9b82pgFHJa3t1wAckLbeooWTI7Qn881UC5fIEgB1UqCh/vMs
2EuA==
X-Gm-Message-State: ACgBeo3bQD6fQgtDb50JtRUb4dkueAEpxaADwDBetnsf/RLIgUf8MAdb
sgD5HWMsnAaHNz2LTnRZZ6CoL5LUWotqWdQTP+Iqb6o6
X-Google-Smtp-Source: AA6agR4xtqgjYE4di2lPQI8ET7xPFG/Qh8r7JyibPFsmeE6HUXOioaHn8ysDB/UOnSNuLKYMIXo0nzbwleOV/Ot0OX4=
X-Received: by 2002:a17:907:3dab:b0:730:933d:ae69 with SMTP id
he43-20020a1709073dab00b00730933dae69mr7422198ejc.500.1659758485036; Fri, 05
Aug 2022 21:01:25 -0700 (PDT)
In-Reply-To: <CAGGBd_qiuEqy8-rpGzN05ZfpspCQ+XVmvim4=Hso8Ti_zVAmxA@mail.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: <CAPTjJmr0Qd0Aj-3HF65-WoNFb5O9D7F05oC0Me8ORb0RxyqPng@mail.gmail.com>
X-Mailman-Original-References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me> <62ed7557.050a0220.1d68f.2d24@mx.google.com>
<CAGGBd_qiuEqy8-rpGzN05ZfpspCQ+XVmvim4=Hso8Ti_zVAmxA@mail.gmail.com>
 by: Chris Angelico - Sat, 6 Aug 2022 04:01 UTC

On Sat, 6 Aug 2022 at 13:54, Dan Stromberg <drsalists@gmail.com> wrote:
>
> On Fri, Aug 5, 2022 at 12:54 PM Grant Edwards <grant.b.edwards@gmail.com>
> wrote:
>
> > In C, this doesn't do what it looks like it's supposed to do.
> >
> > if (foo)
> > do_this();
> > and_this();
> > then_do_this();
> >
> It's been quite a while since I used C, but with the right compiler
> flag(s), I think this may be a thing of the past when compiling with gcc:
> https://developers.redhat.com/blog/2016/02/26/gcc-6-wmisleading-indentation-vs-goto-fail

Ah yes, because compiler warnings are always viewed and acted upon.

Have you ever watched the compilation of a large open-source project,
done using the project's own build system and therefore the team's
preferred warning settings? It's normal to have such a spew of
warnings that you can't find anything interesting, or to have new
warnings in new versions of GCC be utterly useless for the same
reason.

ChrisA

Re: Trying to understand nested loops

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: Rich...@Damon-Family.org (Richard Damon)
Newsgroups: comp.lang.python
Subject: Re: Trying to understand nested loops
Date: Sat, 6 Aug 2022 08:06:40 -0400
Lines: 39
Message-ID: <mailman.215.1659787604.20444.python-list@python.org>
References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me> <62ed7557.050a0220.1d68f.2d24@mx.google.com>
<CAGGBd_qiuEqy8-rpGzN05ZfpspCQ+XVmvim4=Hso8Ti_zVAmxA@mail.gmail.com>
<CAPTjJmr0Qd0Aj-3HF65-WoNFb5O9D7F05oC0Me8ORb0RxyqPng@mail.gmail.com>
<7bb4f809-d0f4-c30e-a2cb-516ab8a961fa@Damon-Family.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de asT2GdPXnXgVqAGwgbQ+GAKpMHtpoAX1UeOMb3n77CFQ==
Return-Path: <Richard@Damon-Family.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'looks': 0.02; 'project,':
0.03; '2022': 0.05; 'aug': 0.07; 'url:02': 0.07; 'angelico': 0.09;
'compiler': 0.09; 'damon': 0.09; 'dan': 0.09; 'enabled': 0.09;
'open-source': 0.09; "shouldn't": 0.09; 'subject:Trying': 0.09;
'anything,': 0.16; 'chrisa': 0.16; 'from:addr:damon-family.org':
0.16; 'from:addr:richard': 0.16; 'from:name:richard damon': 0.16;
'interesting,': 0.16; 'message-id:@Damon-Family.org': 0.16;
'reason.': 0.16; 'received:74.208.4.194': 0.16; 'subject:nested':
0.16; 'useless': 0.16; 'wrote:': 0.16; 'grant': 0.17; "can't":
0.17; 'to:addr:python-list': 0.20; 'option': 0.20; 'fri,': 0.22;
'sat,': 0.22; 'code': 0.23; 'anything': 0.25; 'past': 0.25;
'done': 0.28; '>>>': 0.28; 'chris': 0.28; 'header:User-Agent:1':
0.30; 'am,': 0.31; 'think': 0.32; "doesn't": 0.32; 'do.': 0.32;
'but': 0.32; 'url:blog': 0.33; 'same': 0.34; 'mean': 0.34; 'header
:In-Reply-To:1': 0.34; 'yes,': 0.35; 'fix': 0.36; 'using': 0.37;
"it's": 0.37; 'received:192.168': 0.37; 'quite': 0.39; 'adding':
0.39; 'ever': 0.63; 'richard': 0.64; 'your': 0.64; 'right': 0.68;
'acted': 0.69; 'url:2016': 0.70; 'care': 0.71; 'url-
ip:104.110.240/24': 0.75; 'url-ip:104.110/16': 0.75; 'supposed':
0.76; 'about,': 0.84; "team's": 0.84; 'url:26': 0.84; 'warning':
0.84; 'viewed': 0.93
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.12.0
Content-Language: en-US
In-Reply-To: <CAPTjJmr0Qd0Aj-3HF65-WoNFb5O9D7F05oC0Me8ORb0RxyqPng@mail.gmail.com>
X-Provags-ID: V03:K1:p59Zy/TQVhSFSclxDnk6PdOmKT9s1tJjS4ZYmN1KnxYd+NE/LGp
nbIztyfvN2VDoQjDP9mUHnUhV1PtQLYayyQZD5p/t68yobCk7gUHHwlnuo0pW//1mkLn8uP
tRLwscbEY2ysUCrw9+j4ANaHItzCyh3+fFbSTiRBKSF+BYordRqFGjmfWazYQktUjesq/Kr
7tIdXAOrWh8sgeLaH3Kgw==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:jsHliKQv/Mc=:yRKqwL/b3gMAzEunZeF5vW
tSHbXONB8dch2Mr7ZcQN9AjLZclVB0OsEi5rpVYtOpanmZfY0ca35sb66Q2jY2c7kFEnxC2Dr
Fsubrm6jFXmxbgmqZh1MLARC9M3ZU9tAk8fKBREe/llhc6rZFHEqHhyjdBNiY1T7ZjVbQaljr
CIopEtsq0gksmC9PYyNiXzgi8nUoKhVHKYo1MN0UDTDiw+NjSoiLKiJ65Hvaw7ijqnLxf5Z1L
XPUgFpSZCGBfcoADZGvzlnlFlvo8HEWB/if6fCP1YY4M8JaRwsKWtBzfw3x5tvTiVmEL+wuOc
m0n0Gk9xlY6eUIRY7inV5xnuaCXLEN7KWgQdUNJoN1DleN8sMxvA7Fq+bG5ycmbJG+DuPZ1+I
bQDyOJVZRXmJdgVjZE99CyzRtp75NOUE2CnKYdSZ8zp6W/Lde+QaA6wxMhGBzVIXe7tLDCB41
LCE0VUR6XBcIiefdPV4V4td19UF7+C4mPrDytB2iPN6CssHy7IEAXxaU/0kNA7Vdg3jUgYrhz
n3DkSWHUFWOsN10t+fOTiePEiccJSARuZHP6IFIrvInrO+p9ULjrael7+J16HiQf4hTwGfvIR
FK8Pz2XFqCJEE2tZH0h1xkOg6EWnyvxMo5+v9n22S7X3sNzWnUWw+1KVTWrqW+GMO/Nz3ATgK
YCsOp9WX8zStSU+1mXmK0bOHBVM02T4F6XeafQRSD/b4e+iL792ZndxkUnrCfNglsg99+gW7c
ZjYRKNrkspTcqr1X/R7ldKey1V7zn88L5ql7TQlY9Mby2znBLT+zkIdGzh4=
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: <7bb4f809-d0f4-c30e-a2cb-516ab8a961fa@Damon-Family.org>
X-Mailman-Original-References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me> <62ed7557.050a0220.1d68f.2d24@mx.google.com>
<CAGGBd_qiuEqy8-rpGzN05ZfpspCQ+XVmvim4=Hso8Ti_zVAmxA@mail.gmail.com>
<CAPTjJmr0Qd0Aj-3HF65-WoNFb5O9D7F05oC0Me8ORb0RxyqPng@mail.gmail.com>
 by: Richard Damon - Sat, 6 Aug 2022 12:06 UTC

On 8/6/22 12:01 AM, Chris Angelico wrote:
> On Sat, 6 Aug 2022 at 13:54, Dan Stromberg <drsalists@gmail.com> wrote:
>> On Fri, Aug 5, 2022 at 12:54 PM Grant Edwards <grant.b.edwards@gmail.com>
>> wrote:
>>
>>> In C, this doesn't do what it looks like it's supposed to do.
>>>
>>> if (foo)
>>> do_this();
>>> and_this();
>>> then_do_this();
>>>
>> It's been quite a while since I used C, but with the right compiler
>> flag(s), I think this may be a thing of the past when compiling with gcc:
>> https://developers.redhat.com/blog/2016/02/26/gcc-6-wmisleading-indentation-vs-goto-fail
> Ah yes, because compiler warnings are always viewed and acted upon.
>
> Have you ever watched the compilation of a large open-source project,
> done using the project's own build system and therefore the team's
> preferred warning settings? It's normal to have such a spew of
> warnings that you can't find anything interesting, or to have new
> warnings in new versions of GCC be utterly useless for the same
> reason.
>
> ChrisA

You make it so you HAVE to fix the warning by adding the option to make
warnings into errors.

This does mean that you need to fix all the warnings that don't actually
mean anything,

Good code shouldn't generate many warnings, either you have warnings
enabled that you don't care about, or your code is doing things you have
told the complier you shouldn't do.

--
Richard Damon

Re: Trying to understand nested loops

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ros...@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: Trying to understand nested loops
Date: Sat, 6 Aug 2022 22:12:21 +1000
Lines: 52
Message-ID: <mailman.216.1659787955.20444.python-list@python.org>
References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me> <62ed7557.050a0220.1d68f.2d24@mx.google.com>
<CAGGBd_qiuEqy8-rpGzN05ZfpspCQ+XVmvim4=Hso8Ti_zVAmxA@mail.gmail.com>
<CAPTjJmr0Qd0Aj-3HF65-WoNFb5O9D7F05oC0Me8ORb0RxyqPng@mail.gmail.com>
<7bb4f809-d0f4-c30e-a2cb-516ab8a961fa@Damon-Family.org>
<CAPTjJmpv5M=9arLhxwq2AWYvcYdXALCkrKCAwxEBMrF9BywDzw@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de BMxmKueljDFX0Fq8Vy3jQgtGDFUr2fGG6r8TxJP5hkiQ==
Return-Path: <rosuav@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=jsKuyXVM;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.006
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'looks': 0.02; 'project,':
0.03; '2022': 0.05; 'aug': 0.07; 'url:02': 0.07; 'angelico': 0.09;
'compiler': 0.09; 'damon': 0.09; 'dan': 0.09; 'enabled': 0.09;
'open-source': 0.09; "shouldn't": 0.09; 'subject:Trying': 0.09;
'anything,': 0.16; 'chrisa': 0.16; 'compiled': 0.16;
'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16;
'impossible': 0.16; 'interesting,': 0.16; 'practically': 0.16;
'reason.': 0.16; 'subject:nested': 0.16; 'useless': 0.16;
'which,': 0.16; 'wrote:': 0.16; 'grant': 0.17; "can't": 0.17;
'to:addr:python-list': 0.20; 'option': 0.20; "i've": 0.22;
'basically': 0.22; 'fri,': 0.22; 'maybe': 0.22; 'sat,': 0.22;
'code': 0.23; 'anything': 0.25; 'past': 0.25; 'cannot': 0.25;
'done': 0.28; '>>>': 0.28; 'chris': 0.28; 'am,': 0.31; 'think':
0.32; "doesn't": 0.32; 'do.': 0.32; 'message-id:@mail.gmail.com':
0.32; 'but': 0.32; 'there': 0.33; 'url:blog': 0.33; 'same': 0.34;
'mean': 0.34; 'header:In-Reply-To:1': 0.34; 'received:google.com':
0.34; 'yes,': 0.35; 'from:addr:gmail.com': 0.35; 'fix': 0.36;
'using': 0.37; "it's": 0.37; 'received:209.85': 0.37;
'received:209': 0.39; 'quite': 0.39; 'adding': 0.39;
'received:209.85.208': 0.39; 'should': 0.40; 'policy': 0.62;
'ever': 0.63; 'once': 0.63; 'becomes': 0.64; 'richard': 0.64;
'source.': 0.64; 'your': 0.64; 'upon': 0.64; 'prevent': 0.67;
'time,': 0.67; 'that,': 0.67; 'right': 0.68; 'acted': 0.69;
'times': 0.69; 'url:2016': 0.70; 'care': 0.71; 'url-
ip:104.110.240/24': 0.75; 'url-ip:104.110/16': 0.75; 'change,':
0.76; 'supposed': 0.76; 'major': 0.78; 'about,': 0.84; 'again:':
0.84; "team's": 0.84; 'url:26': 0.84; 'warning': 0.84; 'errors,':
0.91; 'viewed': 0.93
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:from:to:cc; bh=IYvHu6zXBy8BvpkDF9d6raCqgUI/Srz7A5ggCEUGtGQ=;
b=jsKuyXVM3bzxWJXmsblMroPTk/RnsgKTY18u/oh+rTUpp3/SIbEMxquZkLQHzadhxS
BoYyr9IrUbteA/NsdAO/49ZLSLxPBr4+tmMDxVOGgGRIpNGJn/itsD4SbdX4QQjbFTIT
CvQYIoET+JLdV+YsDGVqYD4GxIukr42kYwlj1NgSgasKE9q90Dy4YTRbNeuWHJro1oEI
ZXTj+QKVM19lzuhc98Kqub5NB9RXwZzvU0IJw3tCt1/xGx6sJSw8XQcDRzuoEC11WvMZ
LaR5P6Us6UKyUsMDKUEY8yNcTRuhoyRQJCVJPRBAVJQPpRtl8oZlhh1UvLdUnNxHV6Q9
fLmg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:x-gm-message-state:from:to:cc;
bh=IYvHu6zXBy8BvpkDF9d6raCqgUI/Srz7A5ggCEUGtGQ=;
b=PtgdVB6T/rw3iCNk0C7Qz1obfiDhbX0L1uz6aUSqSJBHpZEN5IV/tBoTtgzt20WuVZ
3rxmFpucJKOeMPF7Z4RgXx0nZoT1DR50QubCMdmBbhS9u/N7+J/b/ojIdTkjIf0kYRXZ
sYQCStxxtSud8EdabT9QV/QJFchkDcNEFND10MJT3XzqtkoJ3+iTDnlHuLNY9UvK6AX/
xNLTcUATn6fo4um/05wyjSLLlZBSsOpuAgtsvnw9A4pmjTB7qCrBHrFugTBP630gE+Rt
U6fmF4H3H0lrs0MGZUtJa/jL/vjWf6YIlY9gMlw8IVbHKeuAqool8S6+lOsDuIwWjSYe
DJlA==
X-Gm-Message-State: ACgBeo0mhdOs2pbJkc7IisnO84zfFDtO/kqE38Odud6NXv9SEB9vnmYq
GTHujhndJlJg9YBDXPGml/7HoGkp5g/jcVccCxdUudIi
X-Google-Smtp-Source: AA6agR66tZQfFtbbIcIGGW1Xdq8HHukTsYy2eWYdRdfC75tDip3fzFR6HwRJDrfUz6EI7ar5Yw0X2yvM08hme0jBfms=
X-Received: by 2002:aa7:db44:0:b0:43d:267c:edd9 with SMTP id
n4-20020aa7db44000000b0043d267cedd9mr10557349edt.385.1659787953199; Sat, 06
Aug 2022 05:12:33 -0700 (PDT)
In-Reply-To: <7bb4f809-d0f4-c30e-a2cb-516ab8a961fa@Damon-Family.org>
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: <CAPTjJmpv5M=9arLhxwq2AWYvcYdXALCkrKCAwxEBMrF9BywDzw@mail.gmail.com>
X-Mailman-Original-References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me> <62ed7557.050a0220.1d68f.2d24@mx.google.com>
<CAGGBd_qiuEqy8-rpGzN05ZfpspCQ+XVmvim4=Hso8Ti_zVAmxA@mail.gmail.com>
<CAPTjJmr0Qd0Aj-3HF65-WoNFb5O9D7F05oC0Me8ORb0RxyqPng@mail.gmail.com>
<7bb4f809-d0f4-c30e-a2cb-516ab8a961fa@Damon-Family.org>
 by: Chris Angelico - Sat, 6 Aug 2022 12:12 UTC

On Sat, 6 Aug 2022 at 22:08, Richard Damon <Richard@damon-family.org> wrote:
>
> On 8/6/22 12:01 AM, Chris Angelico wrote:
> > On Sat, 6 Aug 2022 at 13:54, Dan Stromberg <drsalists@gmail.com> wrote:
> >> On Fri, Aug 5, 2022 at 12:54 PM Grant Edwards <grant.b.edwards@gmail.com>
> >> wrote:
> >>
> >>> In C, this doesn't do what it looks like it's supposed to do.
> >>>
> >>> if (foo)
> >>> do_this();
> >>> and_this();
> >>> then_do_this();
> >>>
> >> It's been quite a while since I used C, but with the right compiler
> >> flag(s), I think this may be a thing of the past when compiling with gcc:
> >> https://developers.redhat.com/blog/2016/02/26/gcc-6-wmisleading-indentation-vs-goto-fail
> > Ah yes, because compiler warnings are always viewed and acted upon.
> >
> > Have you ever watched the compilation of a large open-source project,
> > done using the project's own build system and therefore the team's
> > preferred warning settings? It's normal to have such a spew of
> > warnings that you can't find anything interesting, or to have new
> > warnings in new versions of GCC be utterly useless for the same
> > reason.
> >
> > ChrisA
>
> You make it so you HAVE to fix the warning by adding the option to make
> warnings into errors.
>
> This does mean that you need to fix all the warnings that don't actually
> mean anything,
>
> Good code shouldn't generate many warnings, either you have warnings
> enabled that you don't care about, or your code is doing things you have
> told the complier you shouldn't do.
>

I say again: have you ever watched the compilation of a large
open-source project? You cannot turn warnings into errors, because
there are ALWAYS warnings. Maybe, once upon a time, the policy was to
ensure that there were no warnings on any major compiler; but times
change, compilers add new warnings, new compilers join the club, and
it becomes practically impossible to prevent warnings. Which, in turn,
makes all warnings basically meaningless.

Hmm. I don't think I've ever compiled gcc from source. Maybe I should
do that, just to see whether gcc itself compiles with no warnings
under gcc.

ChrisA

Re: Trying to understand nested loops

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: Rich...@Damon-Family.org (Richard Damon)
Newsgroups: comp.lang.python
Subject: Re: Trying to understand nested loops
Date: Sat, 6 Aug 2022 08:38:21 -0400
Lines: 76
Message-ID: <mailman.217.1659789508.20444.python-list@python.org>
References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me> <62ed7557.050a0220.1d68f.2d24@mx.google.com>
<CAGGBd_qiuEqy8-rpGzN05ZfpspCQ+XVmvim4=Hso8Ti_zVAmxA@mail.gmail.com>
<CAPTjJmr0Qd0Aj-3HF65-WoNFb5O9D7F05oC0Me8ORb0RxyqPng@mail.gmail.com>
<7bb4f809-d0f4-c30e-a2cb-516ab8a961fa@Damon-Family.org>
<CAPTjJmpv5M=9arLhxwq2AWYvcYdXALCkrKCAwxEBMrF9BywDzw@mail.gmail.com>
<a4e4f187-eeb9-5746-c87a-ea116f61680d@Damon-Family.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de 6hXt4iwT9L78T77Y6V0wrwxhDgF3n5dIoacI+xK4ER4w==
Return-Path: <Richard@Damon-Family.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.001
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'looks': 0.02; 'project,':
0.03; '(for': 0.05; '2022': 0.05; 'repository': 0.05; 'aug': 0.07;
'url:02': 0.07; 'angelico': 0.09; 'compiler': 0.09; 'damon': 0.09;
'dan': 0.09; 'enabled': 0.09; 'open-source': 0.09; "shouldn't":
0.09; 'subject:Trying': 0.09; 'that.': 0.15; '>>>>': 0.16;
'>>>>>': 0.16; 'anything,': 0.16; 'chrisa': 0.16; 'compiled':
0.16; 'from:addr:damon-family.org': 0.16; 'from:addr:richard':
0.16; 'from:name:richard damon': 0.16; 'generates': 0.16;
'impossible': 0.16; 'interesting,': 0.16; 'level,': 0.16;
'message-id:@Damon-Family.org': 0.16; 'practically': 0.16;
'reason.': 0.16; 'received:74.208.4.194': 0.16; 'specify': 0.16;
'subject:nested': 0.16; 'useless': 0.16; 'which,': 0.16; 'wrote:':
0.16; 'grant': 0.17; "can't": 0.17; "aren't": 0.19; 'to:addr
:python-list': 0.20; 'option': 0.20; "i've": 0.22; 'basically':
0.22; 'fri,': 0.22; 'maybe': 0.22; 'sat,': 0.22; 'code': 0.23;
'anything': 0.25; 'past': 0.25; 'cannot': 0.25; 'normally': 0.26;
'done': 0.28; '>>>': 0.28; 'chris': 0.28; 'header:User-Agent:1':
0.30; 'am,': 0.31; 'think': 0.32; "doesn't": 0.32; 'official':
0.32; 'checks': 0.32; 'do.': 0.32; 'specified': 0.32; 'ton': 0.32;
'but': 0.32; 'there': 0.33; 'url:blog': 0.33; 'use,': 0.33;
'same': 0.34; 'mean': 0.34; 'header:In-Reply-To:1': 0.34;
'running': 0.34; 'yes,': 0.35; 'fix': 0.36; 'cases': 0.36;
'source': 0.36; 'using': 0.37; "it's": 0.37; 'received:192.168':
0.37; 'put': 0.38; 'quite': 0.39; 'adding': 0.39; 'least': 0.39;
'should': 0.40; 'higher': 0.60; 'policy': 0.62; 'ever': 0.63;
'once': 0.63; 'skip:m 20': 0.63; 'becomes': 0.64; 'richard': 0.64;
'source.': 0.64; 'your': 0.64; 'upon': 0.64; 'nearly': 0.67;
'prevent': 0.67; 'time,': 0.67; 'that,': 0.67; 'right': 0.68;
'acted': 0.69; 'times': 0.69; 'url:2016': 0.70; 'care': 0.71;
'free': 0.72; 'url-ip:104.110.240/24': 0.75; 'url-ip:104.110/16':
0.75; 'change,': 0.76; 'choice': 0.76; 'supposed': 0.76; 'major':
0.78; 'quality': 0.80; 'about,': 0.84; 'again:': 0.84; "team's":
0.84; 'url:26': 0.84; 'warning': 0.84; 'errors,': 0.91; 'viewed':
0.93
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.12.0
Content-Language: en-US
In-Reply-To: <CAPTjJmpv5M=9arLhxwq2AWYvcYdXALCkrKCAwxEBMrF9BywDzw@mail.gmail.com>
X-Provags-ID: V03:K1:t8j1JlPeHz/mWJ6e0QxYCPI9EDYf8fmYmUSNtEBXS0tq0ebvPOT
womVvH00YveJgdSjFbNSMWKExY3DOe2dfsHA8+tw9PmGAq8B20l5NM0GgVd5pniO0hssrUJ
ZDqmpfqAS3/x0+xQB+Z7JY6i4xTYpDKW0uO/UjvgI6g6Eu/BPBITj0fxbm5mmBBpSafH+xC
WGIFnAUjbxOE0/zEmN91g==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:K2kIlPFPpEY=:US4k9StNP+KREnBUDT+56v
Hk4qw48tjEN91zTVdzNSKlo0EyG6VQEbNIThh52xJq3Ap+U6tjyMf572ceeTztfq9+JiWgUFK
CVTW9sTcFvnC9OaFjHQV1cZP8H0iqQ7Bsx4WkZUSyHq4XT7+vyhxEMs9BJRHdO+mUgBGxiuM9
0b4fem561KTkjU/A5Z32Px3tomWM3FWDczOxOXbpYlpM44aKcptlbQ3eMNWcecmhnrX8x7QlD
e8vaSlMLr8IYmSlAoFpxHb02/vh/DAC2UASx0+tTXHUHKHkE3OJv1+D3vnmlGMetb55Jdoo0V
Iesks9uopydtzVF/waLKt1Fbg5BgHYBKPKmlXkwPy5BlhXd6m++BlFrzNJBuqk17lVYjCeklx
XgKRMk1ycK8fYSbLgoxpkbyC167PmloB5rAEar838AjXDl2mt+EQLsdDdyrJu9KHXp9F9Blp8
jKhr2FYEiuz0j7KoO9KPTq1cgohf9M58kgJZEjFPlBb6uWNN+MNFruDMuQluh4xkWyBLw7yTA
u+uffoyP/FP5L5RtH3WADjIhQhOGALmLzhDFW+iCRNq8pzAA4VIFhJfvvEpxhwibE7DLfFPB9
X3hZzXO9cM2szqa1q+0Prn9eSUzT3DfcJcTPaPxhfZ3AWri3LhLDuOQoI4T0hpKjLWy5jqJAZ
ixixF9pEpFxowNj7mwgyrDtOFh5g4sI+ljqD2SSFjOZnydeRrw/PJw1y98/us/Za8zFFEecO0
96yecsPbxvyIwPLk+AwxwnxOdjFcMqqsFq8FUXCdIx8jQepBptwl/3X5+Ng=
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: <a4e4f187-eeb9-5746-c87a-ea116f61680d@Damon-Family.org>
X-Mailman-Original-References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me> <62ed7557.050a0220.1d68f.2d24@mx.google.com>
<CAGGBd_qiuEqy8-rpGzN05ZfpspCQ+XVmvim4=Hso8Ti_zVAmxA@mail.gmail.com>
<CAPTjJmr0Qd0Aj-3HF65-WoNFb5O9D7F05oC0Me8ORb0RxyqPng@mail.gmail.com>
<7bb4f809-d0f4-c30e-a2cb-516ab8a961fa@Damon-Family.org>
<CAPTjJmpv5M=9arLhxwq2AWYvcYdXALCkrKCAwxEBMrF9BywDzw@mail.gmail.com>
 by: Richard Damon - Sat, 6 Aug 2022 12:38 UTC

On 8/6/22 8:12 AM, Chris Angelico wrote:
> On Sat, 6 Aug 2022 at 22:08, Richard Damon <Richard@damon-family.org> wrote:
>> On 8/6/22 12:01 AM, Chris Angelico wrote:
>>> On Sat, 6 Aug 2022 at 13:54, Dan Stromberg <drsalists@gmail.com> wrote:
>>>> On Fri, Aug 5, 2022 at 12:54 PM Grant Edwards <grant.b.edwards@gmail.com>
>>>> wrote:
>>>>
>>>>> In C, this doesn't do what it looks like it's supposed to do.
>>>>>
>>>>> if (foo)
>>>>> do_this();
>>>>> and_this();
>>>>> then_do_this();
>>>>>
>>>> It's been quite a while since I used C, but with the right compiler
>>>> flag(s), I think this may be a thing of the past when compiling with gcc:
>>>> https://developers.redhat.com/blog/2016/02/26/gcc-6-wmisleading-indentation-vs-goto-fail
>>> Ah yes, because compiler warnings are always viewed and acted upon.
>>>
>>> Have you ever watched the compilation of a large open-source project,
>>> done using the project's own build system and therefore the team's
>>> preferred warning settings? It's normal to have such a spew of
>>> warnings that you can't find anything interesting, or to have new
>>> warnings in new versions of GCC be utterly useless for the same
>>> reason.
>>>
>>> ChrisA
>> You make it so you HAVE to fix the warning by adding the option to make
>> warnings into errors.
>>
>> This does mean that you need to fix all the warnings that don't actually
>> mean anything,
>>
>> Good code shouldn't generate many warnings, either you have warnings
>> enabled that you don't care about, or your code is doing things you have
>> told the complier you shouldn't do.
>>
> I say again: have you ever watched the compilation of a large
> open-source project? You cannot turn warnings into errors, because
> there are ALWAYS warnings. Maybe, once upon a time, the policy was to
> ensure that there were no warnings on any major compiler; but times
> change, compilers add new warnings, new compilers join the club, and
> it becomes practically impossible to prevent warnings. Which, in turn,
> makes all warnings basically meaningless.
>
> Hmm. I don't think I've ever compiled gcc from source. Maybe I should
> do that, just to see whether gcc itself compiles with no warnings
> under gcc.
>
> ChrisA

And for any project, that is a choice THEY made.

For projects where code quality is actually a defined metric, there is
normally a specified warning level (for a specified set of compilers and
versions) that the code needs to compile at least nearly clean at.

Yes, you can get that ton of warnings when at a higher warning level,
but that is why you specify the warning level to use, and put the
specific mitigations/suppressions for the few cases where the code is
correct, but generates that warning.

Yes, you can get a lot of warnings with another compiler, but that is
because you aren't running at the correct warning level for that
compiler, which is why the set of compilers that you are "warning free"
on is specified. When you add a new compiler, it may first not be
warning free until you make the effort (if you ever do) to make it
warning free for that.

Major open source projects will have a "toll gate" on the official
repository that checks that additions keep the code to the standard it
has established,

--
Richard Damon

Re: Trying to understand nested loops

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ros...@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: Trying to understand nested loops
Date: Sat, 6 Aug 2022 22:46:27 +1000
Lines: 71
Message-ID: <mailman.218.1659790000.20444.python-list@python.org>
References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me> <62ed7557.050a0220.1d68f.2d24@mx.google.com>
<CAGGBd_qiuEqy8-rpGzN05ZfpspCQ+XVmvim4=Hso8Ti_zVAmxA@mail.gmail.com>
<CAPTjJmr0Qd0Aj-3HF65-WoNFb5O9D7F05oC0Me8ORb0RxyqPng@mail.gmail.com>
<7bb4f809-d0f4-c30e-a2cb-516ab8a961fa@Damon-Family.org>
<CAPTjJmpv5M=9arLhxwq2AWYvcYdXALCkrKCAwxEBMrF9BywDzw@mail.gmail.com>
<a4e4f187-eeb9-5746-c87a-ea116f61680d@Damon-Family.org>
<CAPTjJmobymAscWRMza_2afi7L-W7O4o4Zpx6=oafH14mM8WUZQ@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de FXZUd5ITeXBVhr7MidgMZwE6KAeQ7PQTbgZxmEFDC+6g==
Return-Path: <rosuav@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=DN9Qk8aL;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.001
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'looks': 0.02; 'project,':
0.03; '2022': 0.05; 'despite': 0.05; 'aug': 0.07; 'url:02': 0.07;
'angelico': 0.09; 'compiler': 0.09; 'damon': 0.09; 'dan': 0.09;
'enabled': 0.09; 'indeed.': 0.09; 'open-source': 0.09;
"shouldn't": 0.09; 'subject:Trying': 0.09; '(b)': 0.16; '>>>>':
0.16; '>>>>>': 0.16; 'anything,': 0.16; 'chrisa': 0.16;
'compiled': 0.16; 'default.': 0.16; 'flag': 0.16;
'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16;
'impossible': 0.16; 'indentation': 0.16; 'interesting,': 0.16;
'parsing': 0.16; 'practically': 0.16; 'preferably': 0.16;
'reason.': 0.16; 'subject:nested': 0.16; 'useless': 0.16;
'which,': 0.16; 'wrote:': 0.16; 'grant': 0.17; "can't": 0.17;
'to:addr:python-list': 0.20; 'option': 0.20; "i've": 0.22;
'basically': 0.22; 'fri,': 0.22; 'maybe': 0.22; 'sat,': 0.22;
'code': 0.23; 'anything': 0.25; 'past': 0.25; 'saying': 0.25;
'cannot': 0.25; 'done': 0.28; '>>>': 0.28; 'chris': 0.28; 'code,':
0.31; 'am,': 0.31; 'think': 0.32; "doesn't": 0.32; 'everyone':
0.32; 'assume': 0.32; 'do.': 0.32; 'false,': 0.32; 'message-
id:@mail.gmail.com': 0.32; 'unless': 0.32; 'but': 0.32; 'there':
0.33; 'url:blog': 0.33; 'same': 0.34; 'mean': 0.34; 'header:In-
Reply-To:1': 0.34; 'received:google.com': 0.34; 'majority': 0.35;
'yes,': 0.35; 'from:addr:gmail.com': 0.35; 'fix': 0.36; 'errors':
0.36; 'really': 0.37; 'using': 0.37; "it's": 0.37;
'received:209.85': 0.37; 'received:209': 0.39; 'quite': 0.39;
'adding': 0.39; 'received:209.85.208': 0.39; 'valid': 0.39; 'use':
0.39; 'exact': 0.40; 'should': 0.40; 'seen': 0.62; 'policy': 0.62;
'ever': 0.63; 'once': 0.63; 'becomes': 0.64; 'richard': 0.64;
'source.': 0.64; 'your': 0.64; 'upon': 0.64; 'bad': 0.67;
'prevent': 0.67; 'time,': 0.67; 'that,': 0.67; 'right': 0.68;
'acted': 0.69; 'vast': 0.69; 'times': 0.69; 'url:2016': 0.70;
'care': 0.71; 'change,': 0.76; 'choice': 0.76; 'supposed': 0.76;
'major': 0.78; 'about,': 0.84; 'again:': 0.84; "team's": 0.84;
'url:26': 0.84; 'warning': 0.84; 'errors,': 0.91; 'viewed': 0.93;
'url-ip:2/8': 0.95
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:from:to:cc; bh=mh6IDl583JTi2YkuhhOExpUfiYES+2HyxOe3mqqoWBU=;
b=DN9Qk8aLj5AZitjnMrf1DvFXenu7o3vWMakHUsCQGFXixA2HhbgMFGShw7CyW6qJOz
/d9f0T9SXdTWKOovDA6vuSfr817am/1+wO0hyesSoWAGX9fy95xES1usw/CXQAko0AFC
GFxVaLE5MAodqU37NcdOQblsms1pB1hZiOY6TGiFiX2NYEpErvDoIJX3Q4VpVr44PI/f
f6J0Y+f2b0QBUDeIVn/Cv+fuQWFsPrrkYmQrmX3Bry1OQKTGnqWzSQ9NuU9ZZJbGpUw/
EwIYKJU2FLxGlOZwkxeKdcDFDVXn1EMGGXLsuRgkXZaBIYWB8EKmN6mzEFkTEvgeZfBH
uZYg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:x-gm-message-state:from:to:cc;
bh=mh6IDl583JTi2YkuhhOExpUfiYES+2HyxOe3mqqoWBU=;
b=tXB6ACzTjSsGcGBHWWTzBzu70sDVYibl3WriTSTB4UfZ9a4A36XTpBTK49KQUITOUE
NGjITygcDBLY6EX4mPbNKBrVGIxCrFftz8ucBRZFrQWudC416lHwfGN3SUgMhNyIyS3U
kKXiN+EEfodbG6aWxHiMIt6nXx32OShWv3/dc83IObF5cZuMxNhdT1MqcD9JtWo5LQXx
qc2QXgEqSuBICy/AfEI8FxNsd0bJ6LDngaxFjk0KAjw8FKUoImPmNBPImowhWO0InSQM
tRHbJ9mMv/Ljq5R0izIu9nu+orMg8d82GekZ90w87szfz/jNAsiqXJo88ds1QMkrDZu1
Q0dA==
X-Gm-Message-State: ACgBeo0OdVU659LHqF4e779U4FIouB2CYLxFHfOjRq434NRnSZAqSzwa
PDLWLGI74FD1QS/FDMA/UNNfmxX4r7QfM0TgC9QGZKY0
X-Google-Smtp-Source: AA6agR51PGplhNN9koSMEUChGfZJSJKp67Z+I/tFYB7GY+qBWmE7dnDbzHhUK2ARfbkF8HSRpJ60DFQNtTVGdEm26WQ=
X-Received: by 2002:a05:6402:5384:b0:431:6d84:b451 with SMTP id
ew4-20020a056402538400b004316d84b451mr10571323edb.46.1659789998560; Sat, 06
Aug 2022 05:46:38 -0700 (PDT)
In-Reply-To: <a4e4f187-eeb9-5746-c87a-ea116f61680d@Damon-Family.org>
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: <CAPTjJmobymAscWRMza_2afi7L-W7O4o4Zpx6=oafH14mM8WUZQ@mail.gmail.com>
X-Mailman-Original-References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me> <62ed7557.050a0220.1d68f.2d24@mx.google.com>
<CAGGBd_qiuEqy8-rpGzN05ZfpspCQ+XVmvim4=Hso8Ti_zVAmxA@mail.gmail.com>
<CAPTjJmr0Qd0Aj-3HF65-WoNFb5O9D7F05oC0Me8ORb0RxyqPng@mail.gmail.com>
<7bb4f809-d0f4-c30e-a2cb-516ab8a961fa@Damon-Family.org>
<CAPTjJmpv5M=9arLhxwq2AWYvcYdXALCkrKCAwxEBMrF9BywDzw@mail.gmail.com>
<a4e4f187-eeb9-5746-c87a-ea116f61680d@Damon-Family.org>
 by: Chris Angelico - Sat, 6 Aug 2022 12:46 UTC

On Sat, 6 Aug 2022 at 22:39, Richard Damon <Richard@damon-family.org> wrote:
>
> On 8/6/22 8:12 AM, Chris Angelico wrote:
> > On Sat, 6 Aug 2022 at 22:08, Richard Damon <Richard@damon-family.org> wrote:
> >> On 8/6/22 12:01 AM, Chris Angelico wrote:
> >>> On Sat, 6 Aug 2022 at 13:54, Dan Stromberg <drsalists@gmail.com> wrote:
> >>>> On Fri, Aug 5, 2022 at 12:54 PM Grant Edwards <grant.b.edwards@gmail.com>
> >>>> wrote:
> >>>>
> >>>>> In C, this doesn't do what it looks like it's supposed to do.
> >>>>>
> >>>>> if (foo)
> >>>>> do_this();
> >>>>> and_this();
> >>>>> then_do_this();
> >>>>>
> >>>> It's been quite a while since I used C, but with the right compiler
> >>>> flag(s), I think this may be a thing of the past when compiling with gcc:
> >>>> https://developers.redhat.com/blog/2016/02/26/gcc-6-wmisleading-indentation-vs-goto-fail
> >>> Ah yes, because compiler warnings are always viewed and acted upon.
> >>>
> >>> Have you ever watched the compilation of a large open-source project,
> >>> done using the project's own build system and therefore the team's
> >>> preferred warning settings? It's normal to have such a spew of
> >>> warnings that you can't find anything interesting, or to have new
> >>> warnings in new versions of GCC be utterly useless for the same
> >>> reason.
> >>>
> >>> ChrisA
> >> You make it so you HAVE to fix the warning by adding the option to make
> >> warnings into errors.
> >>
> >> This does mean that you need to fix all the warnings that don't actually
> >> mean anything,
> >>
> >> Good code shouldn't generate many warnings, either you have warnings
> >> enabled that you don't care about, or your code is doing things you have
> >> told the complier you shouldn't do.
> >>
> > I say again: have you ever watched the compilation of a large
> > open-source project? You cannot turn warnings into errors, because
> > there are ALWAYS warnings. Maybe, once upon a time, the policy was to
> > ensure that there were no warnings on any major compiler; but times
> > change, compilers add new warnings, new compilers join the club, and
> > it becomes practically impossible to prevent warnings. Which, in turn,
> > makes all warnings basically meaningless.
> >
> > Hmm. I don't think I've ever compiled gcc from source. Maybe I should
> > do that, just to see whether gcc itself compiles with no warnings
> > under gcc.
> >
> > ChrisA
>
> And for any project, that is a choice THEY made.

Indeed. So you can't really say "good code shouldn't generate many
warnings" unless (a) you're saying that lots of projects are made up
of bad code, or (b) your statement that this is "a thing of the past"
is flat-out false, because it can only be valid if you assume that
everyone has that warning enabled, and preferably set to be an error.

So, for the vast majority of projects out there, indentation errors
are going to continue to go uncaught by C compilers. It's not "a thing
of the past" until most projects use the flag, and preferably, the
flag becomes active by default.

And for the record, I have seen spurious warnings from *that exact
flag* in a large project (an image parsing library). Spurious in that
the code was actually correct, despite the compiler warning about it.

ChrisA

RE: Trying to understand nested loops

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From:
Newsgroups: comp.lang.python
Subject: RE: Trying to understand nested loops
Date: Sat, 6 Aug 2022 12:37:26 -0400
Lines: 94
Message-ID: <mailman.219.1659803854.20444.python-list@python.org>
References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me> <62ed7557.050a0220.1d68f.2d24@mx.google.com>
<CAGGBd_qiuEqy8-rpGzN05ZfpspCQ+XVmvim4=Hso8Ti_zVAmxA@mail.gmail.com>
<CAPTjJmr0Qd0Aj-3HF65-WoNFb5O9D7F05oC0Me8ORb0RxyqPng@mail.gmail.com>
<7bb4f809-d0f4-c30e-a2cb-516ab8a961fa@Damon-Family.org>
<CAPTjJmpv5M=9arLhxwq2AWYvcYdXALCkrKCAwxEBMrF9BywDzw@mail.gmail.com>
<007b01d8a9b2$d0cf9ed0$726edc70$@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de yA+EO25H1nJNw9C4Cbc9FwvTPreftd2x/PUSrAugYhng==
Return-Path: <avi.e.gross@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=RaJjdGTB;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.001
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'looks': 0.02; 'project,':
0.03; '2022': 0.05; 'variable': 0.05; 'aug': 0.07; 'lets': 0.07;
'tests': 0.07; 'url:02': 0.07; 'angelico': 0.09; 'compiler': 0.09;
'damon': 0.09; 'dan': 0.09; 'divide': 0.09; 'enabled': 0.09;
'example.': 0.09; 'open-source': 0.09; 'received:209.85.219':
0.09; 'routine': 0.09; "shouldn't": 0.09; 'subject:Trying': 0.09;
'url:mailman': 0.15; 'anything,': 0.16; 'chrisa': 0.16;
'compiled': 0.16; 'consolidated': 0.16; 'dividing': 0.16;
'division': 0.16; 'feature.': 0.16; 'ignored.': 0.16;
'impossible': 0.16; 'instances.': 0.16; 'interesting,': 0.16;
'loops': 0.16; 'mentioned,': 0.16; 'nested': 0.16; 'practically':
0.16; 'reason.': 0.16; 'reminds': 0.16; 'reserving': 0.16;
'silence': 0.16; 'somewhat': 0.16; 'spelling.': 0.16;
'subject:nested': 0.16; 'useless': 0.16; 'want,': 0.16; 'which,':
0.16; 'wrote:': 0.16; 'grant': 0.17; 'instead': 0.17; "can't":
0.17; 'message-id:@gmail.com': 0.18; 'to:addr:python-list': 0.20;
'option': 0.20; 'language': 0.21; "i've": 0.22; 'basically': 0.22;
'fri,': 0.22; 'maybe': 0.22; 'sat,': 0.22; 'code': 0.23;
'anything': 0.25; 'past': 0.25; 'skip:- 10': 0.25; 'url-
ip:188.166.95.178/32': 0.25; 'url-ip:188.166.95/24': 0.25;
'url:listinfo': 0.25; 'cannot': 0.25; 'programming': 0.25; 'url-
ip:188.166/16': 0.25; 'space': 0.26; 'object': 0.26; 'perform':
0.26; 'else': 0.27; 'bit': 0.27; 'done': 0.28; '>>>': 0.28;
'chris': 0.28; 'suggestions': 0.28; 'it,': 0.29; 'am,': 0.31;
'url-ip:188/8': 0.31; 'think': 0.32; "doesn't": 0.32; 'checks':
0.32; 'do.': 0.32; 'nature': 0.32; 'python-list': 0.32; 'zero':
0.32; 'but': 0.32; 'there': 0.33; 'url:blog': 0.33; 'same': 0.34;
'mean': 0.34; 'printing': 0.34; 'header:In-Reply-To:1': 0.34;
'received:google.com': 0.34; 'trying': 0.35; 'words': 0.35;
'yes,': 0.35; 'from:addr:gmail.com': 0.35; 'fix': 0.36; 'errors':
0.36; 'using': 0.37; "it's": 0.37; 'once': 0.63; 'becomes': 0.64;
'improved': 0.64; 're:': 0.64; 'richard': 0.64; 'source.': 0.64;
'your': 0.64; 'upon': 0.64; 'now,': 0.67; 'guaranteed': 0.67;
'prevent': 0.67; 'skip:e 20': 0.67; 'time,': 0.67; 'that,': 0.67;
'right': 0.68; 'exactly': 0.68; 'acted': 0.69; 'times': 0.69;
'them,': 0.70; 'url:2016': 0.70; 'care': 0.71; 'url-
ip:104.110.240/24': 0.75; 'url-ip:104.110/16': 0.75; 'change,':
0.76; 'supposed': 0.76; 'zone': 0.76; 'sent:': 0.78; 'major':
0.78; 'click': 0.83; 'known': 0.84; 'about,': 0.84; 'again:':
0.84; 'contents,': 0.84; 'filling': 0.84; 'jargon': 0.84;
'saturday,': 0.84; 'say,': 0.84; 'spell': 0.84; 'spelling': 0.84;
"team's": 0.84; 'url:26': 0.84; 'warning': 0.84; 'errors,': 0.91;
'grammar': 0.91; 'mistakes': 0.91; 'viewed': 0.93
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=thread-index:content-language:content-transfer-encoding
:mime-version:message-id:date:subject:in-reply-to:references:to:from
:from:to:cc; bh=JDVK38Pwsyjb3WZESldV56i9lCDLgMcHIxtefaQ1yVU=;
b=RaJjdGTB9G2gStDU0dQSdmvIuQCAl5LjDQYHAgK+M6RWvjAUv6e9whhdZezjEwn8OH
wpwQD9iKIq0QJlEYsna7xHOnTIkrd3mAh3MwaImT1XuM5hJ6VtNTRd7NOzwy+E2V9VK6
Cb21QZfV0+Je5xOd+o5BGsVsAV4oj+02WRsM+PTkqr1xS+5Ikt+A7lxPo43yzvQgEogI
MO4SEpeqb3mlgsO/ozjgcBhx2IDRjDrf9yLm+HeeYYx3Gamb1V/4zb3V0M69q0wiu1Ys
qqoruy17+TNtm7zhUjS/+08NQ3HuP/o1OSxqsr9tsXwxBu2ykTuT3F4pkpPiA2i+8jzk
5fdA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=thread-index:content-language:content-transfer-encoding
:mime-version:message-id:date:subject:in-reply-to:references:to:from
:x-gm-message-state:from:to:cc;
bh=JDVK38Pwsyjb3WZESldV56i9lCDLgMcHIxtefaQ1yVU=;
b=nc6wNBNNlo/R+9q24e9BrtXHtuIl8Rs1t1q0xLCy6x6cCzhk4q2P7piBS/EkqYg4PW
h7kalWLnLr7XpmAQXlJoGzzglnLV7dvXQM702LZbFB4upVZRIsDKDPIOKUNsjIRVjbLP
AN/gynNSuIpYXkm7aGyhIzTBVEt5LcgyAsg70qIs2n2zbEBtsxFavKEEfRf3GryYwbAf
ShfAg8AYst/Sb4+nHmB/3Jkg2PewHk4rIQHg1rIuAjGjnVhfT02+D7stX3IYgC2eCr7f
wfkrI8NN92+GDUn7Qiz0/zsaZk9El23GrN1lKoLgOYEbhzEwPm0omikRzsJgdGhv5vOb
5R5w==
X-Gm-Message-State: ACgBeo0XESaa9/HlXw7DvG7ryKEXRP8u0IZD54Igh2O29u70xUciD6mS
aYEnNqCkrvnXIPEQHW03gTwLIrbVj8o=
X-Google-Smtp-Source: AA6agR7No9iUgpvCxcNQKDiXGzotdOAqZhC4tbrxvWT/mF80SZ8hK9krom2/PWMzJEYt/O1aOnQuRw==
X-Received: by 2002:a05:6214:c21:b0:443:a2d2:a685 with SMTP id
a1-20020a0562140c2100b00443a2d2a685mr10010984qvd.52.1659803851783;
Sat, 06 Aug 2022 09:37:31 -0700 (PDT)
In-Reply-To: <CAPTjJmpv5M=9arLhxwq2AWYvcYdXALCkrKCAwxEBMrF9BywDzw@mail.gmail.com>
X-Mailer: Microsoft Outlook 16.0
Content-Language: en-us
Thread-Index: AQOESmWI9HetpIWV3ULA9SG/jzxu8wKS14HYArTzlDwCcdXNswHYoTKTAmBkdPgBsMv80gJnwOiGArd/enKptLglgA==
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: <007b01d8a9b2$d0cf9ed0$726edc70$@gmail.com>
X-Mailman-Original-References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me> <62ed7557.050a0220.1d68f.2d24@mx.google.com>
<CAGGBd_qiuEqy8-rpGzN05ZfpspCQ+XVmvim4=Hso8Ti_zVAmxA@mail.gmail.com>
<CAPTjJmr0Qd0Aj-3HF65-WoNFb5O9D7F05oC0Me8ORb0RxyqPng@mail.gmail.com>
<7bb4f809-d0f4-c30e-a2cb-516ab8a961fa@Damon-Family.org>
<CAPTjJmpv5M=9arLhxwq2AWYvcYdXALCkrKCAwxEBMrF9BywDzw@mail.gmail.com>
 by: - Sat, 6 Aug 2022 16:37 UTC

This reminds me a bit of how routine spelling checkers and often especially
grammar checkers, generate so many suggestions about mistakes as to become
ignored. If you are writing using lots of names and jargon that keep getting
flagged as errors and they are spelled or used exactly as you want, then it
gets to be too annoying and you turn off the feature. Yes, you can sometimes
silence some things in a spell checker that allows you to add words to a
custom dictionary but for now, that dictionary is not known to every
application that checks your spelling.

That can be the nature of the beast. If your compiler decides to warn you
every time you do a division that you might be dividing by zero because you
do not perform the test right before that, then you end up with code that
tests it AGAIN after having arranged for the value to never be zero in the
first place, then test it again when you divide something else by it, ...

I am sure some programming language has some kind of pragma that lets you
whisper to the compiler that this variable at this time is guaranteed not to
be zero, or that the region is in a try/catch zone which will intercept and
fix the results of a divide by zero error.

Just an example. And as you say, new or improved compilers can be made to be
ever more picky about trying to find possible anomalies.

Things are useful when they are somewhat manageable. If a compiler things it
detects 372 places in your code where the same thing needs to be mentioned,
such as reserving space for an object without simultaneously filling it with
some contents, then it would be nice if instead of printing ALL of them, it
consolidated it into one warning and say you can click on something to see
the 372 instances.

-----Original Message-----
From: Python-list <python-list-bounces+avi.e.gross=gmail.com@python.org> On
Behalf Of Chris Angelico
Sent: Saturday, August 6, 2022 8:12 AM
To: python-list@python.org
Subject: Re: Trying to understand nested loops

On Sat, 6 Aug 2022 at 22:08, Richard Damon <Richard@damon-family.org> wrote:
>
> On 8/6/22 12:01 AM, Chris Angelico wrote:
> > On Sat, 6 Aug 2022 at 13:54, Dan Stromberg <drsalists@gmail.com> wrote:
> >> On Fri, Aug 5, 2022 at 12:54 PM Grant Edwards
> >> <grant.b.edwards@gmail.com>
> >> wrote:
> >>
> >>> In C, this doesn't do what it looks like it's supposed to do.
> >>>
> >>> if (foo)
> >>> do_this();
> >>> and_this();
> >>> then_do_this();
> >>>
> >> It's been quite a while since I used C, but with the right compiler
> >> flag(s), I think this may be a thing of the past when compiling with
gcc:
> >> https://developers.redhat.com/blog/2016/02/26/gcc-6-wmisleading-ind
> >> entation-vs-goto-fail
> > Ah yes, because compiler warnings are always viewed and acted upon.
> >
> > Have you ever watched the compilation of a large open-source
> > project, done using the project's own build system and therefore the
> > team's preferred warning settings? It's normal to have such a spew
> > of warnings that you can't find anything interesting, or to have new
> > warnings in new versions of GCC be utterly useless for the same
> > reason.
> >
> > ChrisA
>
> You make it so you HAVE to fix the warning by adding the option to
> make warnings into errors.
>
> This does mean that you need to fix all the warnings that don't
> actually mean anything,
>
> Good code shouldn't generate many warnings, either you have warnings
> enabled that you don't care about, or your code is doing things you
> have told the complier you shouldn't do.
>

I say again: have you ever watched the compilation of a large open-source
project? You cannot turn warnings into errors, because there are ALWAYS
warnings. Maybe, once upon a time, the policy was to ensure that there were
no warnings on any major compiler; but times change, compilers add new
warnings, new compilers join the club, and it becomes practically impossible
to prevent warnings. Which, in turn, makes all warnings basically
meaningless.

Hmm. I don't think I've ever compiled gcc from source. Maybe I should do
that, just to see whether gcc itself compiles with no warnings under gcc.

ChrisA
--
https://mail.python.org/mailman/listinfo/python-list

Re: Trying to understand nested loops

<slrntf1ulp.9eg.dan@djph.net>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: dan...@djph.net (Dan Purgert)
Newsgroups: comp.lang.python
Subject: Re: Trying to understand nested loops
Date: Mon, 8 Aug 2022 11:59:15 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 46
Message-ID: <slrntf1ulp.9eg.dan@djph.net>
References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me> <01f101d8a924$f4f71560$dee54020$@gmail.com>
<e5d45e7f-9213-dc31-3bd9-cc6f78a879c3@DancesWithMice.info>
<mailman.211.1659743861.20444.python-list@python.org>
Injection-Date: Mon, 8 Aug 2022 11:59:15 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="03ede9a42222e8db59f07807ca2e0119";
logging-data="984102"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/MLq0+MW0HYFB2dvEuzHEVz04NZ+GzzZ4="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:GuKP5aghTY8KzeD5oLTLTTiezvk=
X-PGP-KeyID: 0x4CE72860
 by: Dan Purgert - Mon, 8 Aug 2022 11:59 UTC

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

dn wrote:
> On 06/08/2022 11.41, avi.e.gross@gmail.com wrote:
>> I wonder if someone is pulling our leg as they are sending from an
>> invalid email address of "GB <NOTsomeone@microsoft.invalid>" which is
>> a bit sick.
>
> There are a number of folk who use evidently false email addresses - the
> OP's had me amused.
>
> Such 'hiding' is a matter for the List-Admins (thanks for all the work
> exerted on our behalf!) and how it fits with the Code-of-Conduct.

Invalid sending addresses (email@somewhere.invalid) are a standard
practice in Usenet, to combat bots scraping posts for email addresses
(remember, Usenet predates basically all spam prevention tech).

As there is a gateway between the mailing lists and Usenet, I *imagine*
that the use of said invalid addresses are within the rules -- I mean,
if they weren't, the maintainers wouldn't keep the two lists
connected.

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE3asj+xn6fYUcweBnbWVw5UznKGAFAmLw+rkACgkQbWVw5Uzn
KGBT4A/8DR8GWlEgZhcoaLYTnQCfBv8YmykUxQ69/Xwf7o34S/ObtN0WTapgEBkB
xamJHzFKENVeOoFwNgWkAaLSfOm2704DqO4vEJBZmCGrPtLTjHmpQuIcg2c+cjwz
EEaYCuWmQZrviFS9ZeWX4FIMX9IlZ3Sgy7e/qHvdI5jeclw4oltYdRxVO3h9WylM
BXn3Lvqntw+/5xV3vI/B2SODBTkB8a4D0vC64a3NwGqA3eUkyZrJYlVX8igubBwJ
/sDLTy9EOK7wmokoXIHjj7KN+s5bC8idUN/V6DJiE6Z3vU0AOujKsw8jyQbndP9d
7da3gDLECMTHTFuKkj8kWC005aaWdM+GYzm1nofQC0jpINCP88IVce9curm11IQa
AVWmxNBuGtLh8E3iE5WaydkgwZJXAll2cewOtzyJ0H8qeMwcqtL7hcKwdVPSzSYG
JDqcbthDAzJg/PXcLjBHidXNZQ1BhyLw9ySzf+/7buiSsMdHuYZEohHXH4ybRMtL
hlg6r09b5nDbKD7C9hVfL21+mogcX9t+LehsqiPLXssyMHRpTmGRzQ+CBySg5QaV
gXshFJxRqvp9UtL+xw/wNL3wODsaVTU430qSKUI1ov7ClqcUXvEP5cbmKa9ufJ/J
8iDSbAP2B54pGyF9hfF0f8h267bZy13gWWqBqiFoCBZcVkaC/Jo=
=6yDi
-----END PGP SIGNATURE-----

--
|_|O|_|
|_|_|O| Github: https://github.com/dpurgert
|O|O|O| PGP: DDAB 23FB 19FA 7D85 1CC1 E067 6D65 70E5 4CE7 2860

Re: Trying to understand nested loops

<tcr7c0$v325$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: NOTsome...@microsoft.invalid (GB)
Newsgroups: comp.lang.python
Subject: Re: Trying to understand nested loops
Date: Mon, 8 Aug 2022 15:42:09 +0100
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <tcr7c0$v325$1@dont-email.me>
References: <D50821A2-0B73-478B-8898-6858122D27B7@gmail.com>
<1c043e8f-47c9-153e-84c3-8343a28247db@chagford.com>
<mailman.200.1659686206.20444.python-list@python.org>
<tcipgj$347ur$1@dont-email.me> <01f101d8a924$f4f71560$dee54020$@gmail.com>
<e5d45e7f-9213-dc31-3bd9-cc6f78a879c3@DancesWithMice.info>
<mailman.211.1659743861.20444.python-list@python.org>
<slrntf1ulp.9eg.dan@djph.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 8 Aug 2022 14:42:08 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="216b0c14585c938179cd801cf4cd91e5";
logging-data="1018949"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1875+57YyQY6Nv8grl74RL6"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:Bi9XNLPEzDdAkBktOVxllNPB7oY=
In-Reply-To: <slrntf1ulp.9eg.dan@djph.net>
Content-Language: en-GB
 by: GB - Mon, 8 Aug 2022 14:42 UTC

On 08/08/2022 12:59, Dan Purgert wrote:
> dn wrote:
>> On 06/08/2022 11.41, avi.e.gross@gmail.com wrote:
>>> I wonder if someone is pulling our leg as they are sending from an
>>> invalid email address of "GB <NOTsomeone@microsoft.invalid>" which is
>>> a bit sick.
>
>> There are a number of folk who use evidently false email addresses - the
>> OP's had me amused.
>
>> Such 'hiding' is a matter for the List-Admins (thanks for all the work
>> exerted on our behalf!) and how it fits with the Code-of-Conduct.
>
> Invalid sending addresses (email@somewhere.invalid) are a standard
> practice in Usenet, to combat bots scraping posts for email addresses
> (remember, Usenet predates basically all spam prevention tech).
>
> As there is a gateway between the mailing lists and Usenet, I *imagine*
> that the use of said invalid addresses are within the rules -- I mean,
> if they weren't, the maintainers wouldn't keep the two lists
> connected.
>
>
>

The history in my case is as follows:

Years ago, I used Outlook Express, and, for setting up NG access, they
suggested an example email address: someone@microsoft.com.

I did not want to give my true email address, lest it be 'scraped', so I
used: NOTsomeone@microsoft.com. I added the NOT, to avoid misleading
people.

Later, I was prevailed upon to change com to invalid.

List admins? This particular NG appears to be blessedly free of spam,
but I hadn't realised it is moderated?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor