Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #229: wrong polarity of neutron flow


comp / comp.unix.shell / Re: Python (was Re: I did not inhale)

SubjectAuthor
* Re: I did not inhaleStefan Ram
`* Re: I did not inhaleKalevi Kolttonen
 `* Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  +* Re: Python (was Re: I did not inhale)Kaz Kylheku
  |`* Re: Python (was Re: I did not inhale)Kalevi Kolttonen
  | +* Re: Python (was Re: I did not inhale)John Ames
  | |`- Re: Python (was Re: I did not inhale)D
  | +* Re: Python (was Re: I did not inhale)Muttley
  | |+* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | ||+* Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | |||`* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | ||| +* Re: Python (was Re: I did not inhale)Muttley
  | ||| |`* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | ||| | `* Re: Python (was Re: I did not inhale)Muttley
  | ||| |  +* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | ||| |  |+* Re: Python (was Re: I did not inhale)Kaz Kylheku
  | ||| |  ||`- Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | ||| |  |+- Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | ||| |  |+- Re: Python (was Re: I did not inhale)Muttley
  | ||| |  |`* Re: Python (was Re: I did not inhale)Sebastian
  | ||| |  | `* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | ||| |  |  +* Re: Python (was Re: I did not inhale)vallor
  | ||| |  |  |`- Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | ||| |  |  `- Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | ||| |  `- Re: Python (was Re: I did not inhale)Richard Kettlewell
  | ||| +* Re: Python (was Re: I did not inhale)Kenny McCormack
  | ||| |`- Re: Python (was Re: I did not inhale)Muttley
  | ||| +* Re: Python (was Re: I did not inhale)Kaz Kylheku
  | ||| |`* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | ||| | `* Re: Python (was Re: I did not inhale)Kaz Kylheku
  | ||| |  `* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | ||| |   `- Re: Python (was Re: I did not inhale)Kaz Kylheku
  | ||| `* Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | |||  `* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | |||   +* Re: Python (was Re: I did not inhale)David Brown
  | |||   |`* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | |||   | +* Re: Python (was Re: I did not inhale)Muttley
  | |||   | |`* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | |||   | | +- Re: Python (was Re: I did not inhale)Muttley
  | |||   | | `- Re: Python (was Re: I did not inhale)Bozo User
  | |||   | +* Re: Python (was Re: I did not inhale)David Brown
  | |||   | |`* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | |||   | | +* Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | |||   | | |`* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | |||   | | | `- Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | |||   | | `* Re: Python (was Re: I did not inhale)David Brown
  | |||   | |  `* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | |||   | |   +* Re: Python (was Re: I did not inhale)David Brown
  | |||   | |   |`- Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | |||   | |   `* Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | |||   | |    `* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | |||   | |     `- Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | |||   | `* Re: Python (was Re: I did not inhale)Keith Thompson
  | |||   |  `* Re: Python (was Re: I did not inhale)John Ames
  | |||   |   +- Re: Python (was Re: I did not inhale)Muttley
  | |||   |   `- Re: Python (was Re: I did not inhale)Stefan Ram
  | |||   +* Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | |||   |`* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | |||   | +* Re: Python (was Re: I did not inhale)Keith Thompson
  | |||   | |`- Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | |||   | `* Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | |||   |  `* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | |||   |   +- Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | |||   |   `- Re: Python (was Re: I did not inhale)D
  | |||   `* Re: Python (was Re: I did not inhale)vallor
  | |||    `- Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | ||`- Re: Python (was Re: I did not inhale)Muttley
  | |`* Re: Python (was Re: I did not inhale)David Brown
  | | `- Re: Python (was Re: I did not inhale)Muttley
  | `* Re: Python (was Re: I did not inhale)David Brown
  |  +* Re: Python (was Re: I did not inhale)Keith Thompson
  |  |`- Re: Python (was Re: I did not inhale)David Brown
  |  `* Re: Python (was Re: I did not inhale)Kalevi Kolttonen
  |   +* Re: Python (was Re: I did not inhale)Muttley
  |   |+- Re: Python (was Re: I did not inhale)Lew Pitcher
  |   |`- Re: Python (was Re: I did not inhale)Kalevi Kolttonen
  |   +* Re: Python (was Re: I did not inhale)David Brown
  |   |`* Re: Python (was Re: I did not inhale)Kalevi Kolttonen
  |   | +* Re: Python (was Re: I did not inhale)David Brown
  |   | |+* Re: Python (was Re: I did not inhale)Muttley
  |   | ||`* Re: Python (was Re: I did not inhale)David Brown
  |   | || `* Re: Python (was Re: I did not inhale)Muttley
  |   | ||  `* Re: Python (was Re: I did not inhale)David Brown
  |   | ||   `* Re: Python (was Re: I did not inhale)Muttley
  |   | ||    `* Re: Python (was Re: I did not inhale)David Brown
  |   | ||     `* Re: Python (was Re: I did not inhale)Muttley
  |   | ||      +* Re: Python (was Re: I did not inhale)D
  |   | ||      |+* Re: Python (was Re: I did not inhale)Muttley
  |   | ||      ||`* Re: Python (was Re: I did not inhale)D
  |   | ||      || `* Re: Python (was Re: I did not inhale)Lew Pitcher
  |   | ||      ||  `- Re: Python (was Re: I did not inhale)Muttley
  |   | ||      |`- Re: Python (was Re: I did not inhale)David Brown
  |   | ||      `* Re: Python (was Re: I did not inhale)David Brown
  |   | ||       +* Re: Python (was Re: I did not inhale)Muttley
  |   | ||       |`* Re: Python (was Re: I did not inhale)John Ames
  |   | ||       | +- Re: Python (was Re: I did not inhale)Muttley
  |   | ||       | `* Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  |   | ||       |  +* Re: Python (was Re: I did not inhale)John Ames
  |   | ||       |  |+- Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  |   | ||       |  |+- Re: Python (was Re: I did not inhale)Sebastian
  |   | ||       |  |`* Re: Python (was Re: I did not inhale)Richard Kettlewell
  |   | ||       |  +* Re: Python (was Re: I did not inhale)Bart
  |   | ||       |  `- Re: Python (was Re: I did not inhale)Kaz Kylheku
  |   | ||       `* Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  |   | |`* Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  |   | `* Re: Python (was Re: I did not inhale)Muttley
  |   `* Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  `* Re: Python (was Re: I did not inhale)Kalevi Kolttonen

Pages:12345678910
Subject: Re: Python (was Re: I did not inhale)
From: Lawrence D'Oliv
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Tue, 27 Aug 2024 21:40 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Tue, 27 Aug 2024 21:40:19 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <valh42$34s18$2@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
<v9t204$2dofg$1@dont-email.me> <va28pi$3dldm$1@dont-email.me>
<va2ro9$3gd7v$1@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vak9k9$2ujrs$1@dont-email.me> <vakj7g$303sh$1@dont-email.me>
<20240827080320.00003fd2@gmail.com> <val6u3$33e82$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 27 Aug 2024 23:40:19 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="2836e4fdb00ca78ddad73240b3d2d9a3";
logging-data="3305512"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/bCNv57dddctUB+zB+S+Pb"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:n/GugX4j7sb2GeAzS3kp5wsC2Zg=
View all headers

On Tue, 27 Aug 2024 20:46:27 +0200, David Brown wrote:

> It is not common to have to have indent comment lines (certainly in
> Python it is not necessary). And if you find yourself writing large
> comments in the middle of a block in the middle of a function, it is
> probably time to consider re-organising the code and/or the comments and
> documentation. (Again, there can be exceptions to this general rule.)

Counterexample: <https://www.cairographics.org/cookbook/freetypepython/>
(Yes, that’s one of mine). Note the explanation of the user-data dance,
for backward compatibility with older FreeType. Where else would you put
the comments, if not next to the code they’re explaining?

Subject: Re: Python (was Re: I did not inhale)
From: Keith Thompson
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: None to speak of
Date: Tue, 27 Aug 2024 21:49 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Tue, 27 Aug 2024 14:49:19 -0700
Organization: None to speak of
Lines: 35
Message-ID: <87y14hd4bk.fsf@nosuchdomain.example.com>
References: <uu54la$3su5b$6@dont-email.me> <v9t204$2dofg$1@dont-email.me>
<va28pi$3dldm$1@dont-email.me> <va2ro9$3gd7v$1@dont-email.me>
<va2vt0$3h3gj$1@dont-email.me> <va44rh$3p1l6$1@dont-email.me>
<va45eq$3pkt9$1@dont-email.me> <va4aut$3q4g0$1@dont-email.me>
<va4fbr$3qvij$1@dont-email.me> <va5108$3tmmd$1@dont-email.me>
<va51ok$3tqr9$1@dont-email.me> <va5ec2$3vluh$1@dont-email.me>
<va6q4g$c1a7$1@dont-email.me> <va6rpa$c6bg$1@dont-email.me>
<va6se9$cb8e$1@dont-email.me> <20240826083330.00004760@gmail.com>
<vaises$2k7o6$2@dont-email.me> <20240826155113.000005ba@gmail.com>
<wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vak9k9$2ujrs$1@dont-email.me>
<valgpu$34s18$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 27 Aug 2024 23:49:23 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="90d986288334bd92d1400f11de39bcef";
logging-data="3296451"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19TsZj2dBgYzT5YAEhdgB5n"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:gxdqAdIBb+1sh31SPfimODBmkK8=
sha1:3pf9kpBZwSw+gfhM8+oj0vlIoXk=
View all headers

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
> On Tue, 27 Aug 2024 11:26:18 +0100, Bart wrote:
[...]
>> And, also the block then merges with the
>> following one as it's at the same level, so when you want to change it
>> back...
>
> This is where my “#end” comments come in.
[...]

It's worth noting that you're the only person I've ever heard of
who feels the need to do this. People here who aren't familiar
with Python should be aware that this is not common practice.

I've done some Python programming, and it wouldn't occur to me to
add "#end" comments. If I saw them in a code review I'd probably
recommend deleting them. I prefer to approach each language on
its own terms. (I happen to like the way Python uses semantically
significant indentation, but even if I didn't I'd still do the same.)

In brace-delimited languages (C, C++, Perl, etc.), I'm very careful
to keep the indentation consistent with the program structure.
I do the same in Python. The difference is that in Python the
indentation is the single source of truth about program structure,
while in other languages it's a matter of convention.

https://en.wikipedia.org/wiki/Single_source_of_truth

As for tabs vs. spaces, my understanding is that recent versions
of Perl allow mixing them (something I avoid), but if the meaning
can change depending on the size of a tabstop the code is rejected.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */

Subject: Re: Python (was Re: I did not inhale)
From: Lawrence D'Oliv
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Tue, 27 Aug 2024 23:28 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Tue, 27 Aug 2024 23:28:18 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <valnei$35rt8$2@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <v9t204$2dofg$1@dont-email.me>
<va28pi$3dldm$1@dont-email.me> <va2ro9$3gd7v$1@dont-email.me>
<va2vt0$3h3gj$1@dont-email.me> <va44rh$3p1l6$1@dont-email.me>
<va45eq$3pkt9$1@dont-email.me> <va4aut$3q4g0$1@dont-email.me>
<va4fbr$3qvij$1@dont-email.me> <va5108$3tmmd$1@dont-email.me>
<va51ok$3tqr9$1@dont-email.me> <va5ec2$3vluh$1@dont-email.me>
<va6q4g$c1a7$1@dont-email.me> <va6rpa$c6bg$1@dont-email.me>
<va6se9$cb8e$1@dont-email.me> <20240826083330.00004760@gmail.com>
<vaises$2k7o6$2@dont-email.me> <20240826155113.000005ba@gmail.com>
<wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vak9k9$2ujrs$1@dont-email.me>
<valgpu$34s18$1@dont-email.me> <87y14hd4bk.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 28 Aug 2024 01:28:19 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="52d1e1001450c2fe7f8121ab25cdb228";
logging-data="3338152"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18WcnL2avWjz/1mFfaIBunZ"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:ZQPRibKyZokd+4OhUNmy/1/ojcY=
View all headers

On Tue, 27 Aug 2024 14:49:19 -0700, Keith Thompson wrote:

> I've done some Python programming, and it wouldn't occur to me to add
> "#end" comments. If I saw them in a code review I'd probably recommend
> deleting them.

Give them a try. They simplify a lot of situations. I already posted a
reasonably complex example in this thread. Go have a look at it, and see
what happens when you delete those comments.

Subject: Re: Python (was Re: I did not inhale)
From: Keith Thompson
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: None to speak of
Date: Wed, 28 Aug 2024 02:10 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Tue, 27 Aug 2024 19:10:57 -0700
Organization: None to speak of
Lines: 15
Message-ID: <87ikvlcs7i.fsf@nosuchdomain.example.com>
References: <uu54la$3su5b$6@dont-email.me> <va2ro9$3gd7v$1@dont-email.me>
<va2vt0$3h3gj$1@dont-email.me> <va44rh$3p1l6$1@dont-email.me>
<va45eq$3pkt9$1@dont-email.me> <va4aut$3q4g0$1@dont-email.me>
<va4fbr$3qvij$1@dont-email.me> <va5108$3tmmd$1@dont-email.me>
<va51ok$3tqr9$1@dont-email.me> <va5ec2$3vluh$1@dont-email.me>
<va6q4g$c1a7$1@dont-email.me> <va6rpa$c6bg$1@dont-email.me>
<va6se9$cb8e$1@dont-email.me> <20240826083330.00004760@gmail.com>
<vaises$2k7o6$2@dont-email.me> <20240826155113.000005ba@gmail.com>
<wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vak9k9$2ujrs$1@dont-email.me>
<valgpu$34s18$1@dont-email.me>
<87y14hd4bk.fsf@nosuchdomain.example.com>
<valnei$35rt8$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Wed, 28 Aug 2024 04:10:59 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="1017e97994ee365b6a0a4b9b05fc05d0";
logging-data="3496974"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19WWrky5oy2tfNZA0tcNqMU"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:e9rcfbY/OqRYhPTddFc0zBSIibo=
sha1:ni8LRIlgBrCWKGEtFiy/BkF+ZAk=
View all headers

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
> On Tue, 27 Aug 2024 14:49:19 -0700, Keith Thompson wrote:
>> I've done some Python programming, and it wouldn't occur to me to add
>> "#end" comments. If I saw them in a code review I'd probably recommend
>> deleting them.
>
> Give them a try. They simplify a lot of situations. I already posted a
> reasonably complex example in this thread. Go have a look at it, and see
> what happens when you delete those comments.

No, I won't be doing that.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */

Subject: Re: Python (was Re: I did not inhale)
From: Sebastian
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Wed, 28 Aug 2024 02:48 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: sebastian@here.com.invalid (Sebastian)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 28 Aug 2024 02:48:59 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <vam36p$3avsi$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me> <va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me> <va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me> <va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me> <va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me> <20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me> <20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
Injection-Date: Wed, 28 Aug 2024 04:48:59 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="7d3792c96156c5be2e77b3bcd54591a8";
logging-data="3506066"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19pwNhBW0MG0f5enI5cHqxggUTOWSTBq20="
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.1.0-18-amd64 (x86_64))
Cancel-Lock: sha1:w6+AU4GBfBYe31UeDEPMtjGY7ak=
View all headers

In comp.unix.programmer Richard Kettlewell <invalid@invalid.invalid> wrote:
> John Ames <commodorejohn@gmail.com> writes:
>> But even if that helps you organizationally, it doesn't resolve issues
>> of the interpreter potentially mis-parsing things due to mismatches in
>> tab/space factor between $EDITOR and the Python RTE, which is a truly
>> ridiculous thing to have to be concerned about.
>
> In many years of using Python routinely and extensively I?ve simply
> never found the whitespace issues that people are worrying about here to
> be a problem in practice. Some of this may be a matter of experience but
> if so, it?s a form of experience that must have built up very quickly.

I've seen bugs in production that are due to Python's indentation rules.
Consider this class:

class Foo:
def method1(self):
call1()
call2()
call3()

def method2(self):
call4()
if some_condition:
with some_object() as o:
call5()
# hundreds of other lines of code
call6()

At my company, somebody tried to delete a method like method2() above,
but forgot the last few lines (represented by call6()). This does
not introduce a SyntaxError. Instead, call6() is now part of method1()
because it's at the same level of indentation. In most programming
languages, the beginning of method2() would be preceded by some delimiter
marking the end of method1(), which would prevent an accidental merger
of this type.

Subject: Re: Python (was Re: I did not inhale)
From: Sebastian
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Wed, 28 Aug 2024 02:53 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: sebastian@here.com.invalid (Sebastian)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 28 Aug 2024 02:53:41 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <vam3fj$3avsi$2@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me> <va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me> <va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me> <va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me> <20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me> <20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vak9k9$2ujrs$1@dont-email.me> <wwva5gykuab.fsf@LkoBDZeT.terraraq.uk>
Injection-Date: Wed, 28 Aug 2024 04:53:41 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="7d3792c96156c5be2e77b3bcd54591a8";
logging-data="3506066"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19YoUQxTIdUeiWAcCRvqV8BM1/lA9W1Tso="
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.1.0-18-amd64 (x86_64))
Cancel-Lock: sha1:ps0T6DEUYo1yH30fEzL9Zyi4wGo=
View all headers

In comp.unix.programmer Richard Kettlewell <invalid@invalid.invalid> wrote:
> Bart <bc@freeuk.com> writes:
>> On 27/08/2024 09:39, Richard Kettlewell wrote:
>
>> The fact that people have to resort to adding #end lines, which only
>> partly deals with one or two of those problems, suggest that something
>> is badly wrong.
>
> I?ve never encountered anyone else doing that in Python. It suggests
> more than the individual doing that just doesn?t like the language, in
> which case I?d just suggest that person doesn?t use it.

I think it's a great idea. I'm considering asking my team to start adding
#end comments to our codebase.

Subject: Re: Python (was Re: I did not inhale)
From: Sebastian
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Wed, 28 Aug 2024 03:19 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: sebastian@here.com.invalid (Sebastian)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 28 Aug 2024 03:19:07 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <vam4v9$3avsi$3@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me> <va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me> <va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me> <20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me> <20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vak9k9$2ujrs$1@dont-email.me> <vakj7g$303sh$1@dont-email.me> <20240827080320.00003fd2@gmail.com> <val6u3$33e82$1@dont-email.me>
Injection-Date: Wed, 28 Aug 2024 05:19:08 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="7d3792c96156c5be2e77b3bcd54591a8";
logging-data="3506066"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19kGRmfCuIquR2xMhNLitkBALJ93EmjDR0="
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.1.0-18-amd64 (x86_64))
Cancel-Lock: sha1:KLpnUjkX8C8gH9NRbt0EcF9rchw=
View all headers

In comp.unix.programmer David Brown <david.brown@hesbynett.no> wrote:
>
> It is not common to have to have indent comment lines (certainly in
> Python it is not necessary). And if you find yourself writing large
> comments in the middle of a block in the middle of a function, it is
> probably time to consider re-organising the code and/or the comments and
> documentation. (Again, there can be exceptions to this general rule.)
>

It may not be "common" (ie, not a lot of languages have this requirement),
but if it's your job to maintain a project written in such a language,
then you'll have to deal with that problem every single day.

Subject: Re: Python (was Re: I did not inhale)
From: Lawrence D'Oliv
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Wed, 28 Aug 2024 05:30 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 28 Aug 2024 05:30:31 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <vamclm$3c4ke$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <va2ro9$3gd7v$1@dont-email.me>
<va2vt0$3h3gj$1@dont-email.me> <va44rh$3p1l6$1@dont-email.me>
<va45eq$3pkt9$1@dont-email.me> <va4aut$3q4g0$1@dont-email.me>
<va4fbr$3qvij$1@dont-email.me> <va5108$3tmmd$1@dont-email.me>
<va51ok$3tqr9$1@dont-email.me> <va5ec2$3vluh$1@dont-email.me>
<va6q4g$c1a7$1@dont-email.me> <va6rpa$c6bg$1@dont-email.me>
<va6se9$cb8e$1@dont-email.me> <20240826083330.00004760@gmail.com>
<vaises$2k7o6$2@dont-email.me> <20240826155113.000005ba@gmail.com>
<wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vak9k9$2ujrs$1@dont-email.me>
<valgpu$34s18$1@dont-email.me> <87y14hd4bk.fsf@nosuchdomain.example.com>
<valnei$35rt8$2@dont-email.me> <87ikvlcs7i.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 28 Aug 2024 07:30:31 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="52d1e1001450c2fe7f8121ab25cdb228";
logging-data="3543694"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+kkNhb1k9foNq6QggQ5X6P"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:/OQNXbCzZytb0dXbrbsj0M6CbgI=
View all headers

On Tue, 27 Aug 2024 19:10:57 -0700, Keith Thompson wrote:

> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>
>> On Tue, 27 Aug 2024 14:49:19 -0700, Keith Thompson wrote:
>>>
>>> I've done some Python programming, and it wouldn't occur to me to add
>>> "#end" comments. If I saw them in a code review I'd probably
>>> recommend deleting them.
>>
>> Give them a try. They simplify a lot of situations. I already posted a
>> reasonably complex example in this thread. Go have a look at it, and
>> see what happens when you delete those comments.
>
> No, I won't be doing that.

I wonder why? You expressed an opinion about them, yet when I try to find
out more about why you feel that way, you run away.

Subject: Re: Python (was Re: I did not inhale)
From: David Brown
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Wed, 28 Aug 2024 10:45 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 28 Aug 2024 12:45:40 +0200
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <vamv4k$3eo1d$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <va5108$3tmmd$1@dont-email.me>
<va51ok$3tqr9$1@dont-email.me> <va5ec2$3vluh$1@dont-email.me>
<va6q4g$c1a7$1@dont-email.me> <va6rpa$c6bg$1@dont-email.me>
<va6se9$cb8e$1@dont-email.me> <20240826083330.00004760@gmail.com>
<vaises$2k7o6$2@dont-email.me> <20240826155113.000005ba@gmail.com>
<wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vak9k9$2ujrs$1@dont-email.me>
<vakj7g$303sh$1@dont-email.me> <20240827080320.00003fd2@gmail.com>
<val6u3$33e82$1@dont-email.me> <vam4v9$3avsi$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 28 Aug 2024 12:45:41 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="983d16587e2b5335614c42ef9624d181";
logging-data="3629101"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+6X5SOKWHBdDYiWHV9BHK2Q4VLNxM9kqc="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:CGxy3YhMEJdLq6u3LXTcbZEFxm4=
Content-Language: en-GB
In-Reply-To: <vam4v9$3avsi$3@dont-email.me>
View all headers

On 28/08/2024 05:19, Sebastian wrote:
> In comp.unix.programmer David Brown <david.brown@hesbynett.no> wrote:
>>
>> It is not common to have to have indent comment lines (certainly in
>> Python it is not necessary). And if you find yourself writing large
>> comments in the middle of a block in the middle of a function, it is
>> probably time to consider re-organising the code and/or the comments and
>> documentation. (Again, there can be exceptions to this general rule.)
>>
>
> It may not be "common" (ie, not a lot of languages have this requirement),
> but if it's your job to maintain a project written in such a language,
> then you'll have to deal with that problem every single day.

If you have some code that needs a lot of documentation (and some does),
then put the comments in a place that does not interfere with reading
and understanding the code. Comments that make code harder to read are
counter-productive.

Where these comments end up - elsewhere in the function, outside the
function, at the head of the file, in a separate file, in completely
separate documentation - depends on the situation.

Subject: Re: Python (was Re: I did not inhale)
From: Scott Lurndal
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: UsenetServer - www.usenetserver.com
Date: Wed, 28 Aug 2024 13:57 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!panix!weretis.net!feeder9.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx15.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Python (was Re: I did not inhale)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
References: <uu54la$3su5b$6@dont-email.me> <va4fbr$3qvij$1@dont-email.me> <va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me> <va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me> <va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me> <20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me> <20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vak9k9$2ujrs$1@dont-email.me> <wwva5gykuab.fsf@LkoBDZeT.terraraq.uk> <vam3fj$3avsi$2@dont-email.me>
Lines: 17
Message-ID: <X0GzO.87659$FUV7.50429@fx15.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Wed, 28 Aug 2024 13:57:11 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Wed, 28 Aug 2024 13:57:11 GMT
X-Received-Bytes: 1811
View all headers

Sebastian <sebastian@here.com.invalid> writes:
>In comp.unix.programmer Richard Kettlewell <invalid@invalid.invalid> wrote:
>> Bart <bc@freeuk.com> writes:
>>> On 27/08/2024 09:39, Richard Kettlewell wrote:
>>
>>> The fact that people have to resort to adding #end lines, which only
>>> partly deals with one or two of those problems, suggest that something
>>> is badly wrong.
>>
>> I?ve never encountered anyone else doing that in Python. It suggests
>> more than the individual doing that just doesn?t like the language, in
>> which case I?d just suggest that person doesn?t use it.
>
>I think it's a great idea. I'm considering asking my team to start adding
>#end comments to our codebase.

I think you're a L'D'O sockpuppet.

Subject: Re: Python (was Re: I did not inhale)
From: John Ames
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Wed, 28 Aug 2024 15:25 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: commodorejohn@gmail.com (John Ames)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 28 Aug 2024 08:25:21 -0700
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <20240828082521.00005968@gmail.com>
References: <uu54la$3su5b$6@dont-email.me>
<va44rh$3p1l6$1@dont-email.me>
<va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me>
<va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me>
<va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me>
<va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me>
<va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com>
<vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com>
<wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vam36p$3avsi$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 28 Aug 2024 17:25:25 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="954bec1901ba856c62aa03fa05200c10";
logging-data="3677879"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19/Ykb7KuvbRIx+d+CH/Nb14DMLLlDOr98="
Cancel-Lock: sha1:X+szwsxPo8LfBy9nA0y51+gcWCw=
X-Newsreader: Claws Mail 4.2.0 (GTK 3.24.38; x86_64-w64-mingw32)
View all headers

On Wed, 28 Aug 2024 02:48:59 -0000 (UTC)
Sebastian <sebastian@here.com.invalid> wrote:

> At my company, somebody tried to delete a method like method2() above,
> but forgot the last few lines (represented by call6()). This does
> not introduce a SyntaxError. Instead, call6() is now part of method1()
> because it's at the same level of indentation. In most programming
> languages, the beginning of method2() would be preceded by some
> delimiter marking the end of method1(), which would prevent an
> accidental merger of this type.

(Waiting for the Python advocates to fire back with "well, don't do
that, then!" and completely miss the point that it's exactly the topic
of contention here that Python's scope-by-layout approach that makes it
easy to do that...)

Subject:
From:
Newsgroups:
Date: Sat, 18 Jan 2025 18:59 UTC
Generally, they might point all the ways that such oversights and all
kinds of other typos can result in still-valid code in any language. But
fragile syntax like Python's just makes it so easier to do that.
View all headers

Subject: Re: Python (was Re: I did not inhale)
From: Richard Kettlewell
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: terraraq NNTP server
Date: Wed, 28 Aug 2024 15:41 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!news.gegeweb.eu!gegeweb.org!nntp.terraraq.uk!.POSTED.tunnel.sfere.anjou.terraraq.org.uk!not-for-mail
From: invalid@invalid.invalid (Richard Kettlewell)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 28 Aug 2024 16:41:36 +0100
Organization: terraraq NNTP server
Message-ID: <wwvzfowlknj.fsf@LkoBDZeT.terraraq.uk>
References: <uu54la$3su5b$6@dont-email.me> <va44rh$3p1l6$1@dont-email.me>
<va45eq$3pkt9$1@dont-email.me> <va4aut$3q4g0$1@dont-email.me>
<va4fbr$3qvij$1@dont-email.me> <va5108$3tmmd$1@dont-email.me>
<va51ok$3tqr9$1@dont-email.me> <va5ec2$3vluh$1@dont-email.me>
<va6q4g$c1a7$1@dont-email.me> <va6rpa$c6bg$1@dont-email.me>
<va6se9$cb8e$1@dont-email.me> <20240826083330.00004760@gmail.com>
<vaises$2k7o6$2@dont-email.me> <20240826155113.000005ba@gmail.com>
<wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vam36p$3avsi$1@dont-email.me>
<20240828082521.00005968@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: innmantic.terraraq.uk; posting-host="tunnel.sfere.anjou.terraraq.org.uk:172.17.207.6";
logging-data="55938"; mail-complaints-to="usenet@innmantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:nDXBFfYJdFMoeUyitKOB2cMpiD8=
X-Face: h[Hh-7npe<<b4/eW[]sat,I3O`t8A`(ej.H!F4\8|;ih)`7{@:A~/j1}gTt4e7-n*F?.Rl^
F<\{jehn7.KrO{!7=:(@J~]<.[{>v9!1<qZY,{EJxg6?Er4Y7Ng2\Ft>Z&W?r\c.!4DXH5PWpga"ha
+r0NzP?vnz:e/knOY)PI-
X-Boydie: NO
View all headers

John Ames <commodorejohn@gmail.com> writes:
> Sebastian <sebastian@here.com.invalid> wrote:
>
>> At my company, somebody tried to delete a method like method2()
>> above, but forgot the last few lines (represented by call6()). This
>> does not introduce a SyntaxError. Instead, call6() is now part of
>> method1() because it's at the same level of indentation. In most
>> programming languages, the beginning of method2() would be preceded
>> by some delimiter marking the end of method1(), which would prevent
>> an accidental merger of this type.
>
> (Waiting for the Python advocates to fire back with "well, don't do
> that, then!" and completely miss the point that it's exactly the topic
> of contention here that Python's scope-by-layout approach that makes it
> easy to do that...)

Earlier I wrote:

| (In contrast C’s rules have occasionally been a practical problem,
| contributing to at least one high-profile software vulnerability and
| attracting compiler warnings to mitigate the risks.)

The situation seems pretty similar. In any language if you delete the
wrong thing then you probably won’t like the outcome. In both cases if
it’s not quickly detected by unit tests or some other automation then
it’s probably time to review your approach to quality.

--
https://www.greenend.org.uk/rjk/

Subject: Re: Python (was Re: I did not inhale)
From: David Brown
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Wed, 28 Aug 2024 16:23 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 28 Aug 2024 18:23:31 +0200
Organization: A noiseless patient Spider
Lines: 71
Message-ID: <vaniu4$3hi39$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <va44rh$3p1l6$1@dont-email.me>
<va45eq$3pkt9$1@dont-email.me> <va4aut$3q4g0$1@dont-email.me>
<va4fbr$3qvij$1@dont-email.me> <va5108$3tmmd$1@dont-email.me>
<va51ok$3tqr9$1@dont-email.me> <va5ec2$3vluh$1@dont-email.me>
<va6q4g$c1a7$1@dont-email.me> <va6rpa$c6bg$1@dont-email.me>
<va6se9$cb8e$1@dont-email.me> <20240826083330.00004760@gmail.com>
<vaises$2k7o6$2@dont-email.me> <20240826155113.000005ba@gmail.com>
<wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vam36p$3avsi$1@dont-email.me>
<20240828082521.00005968@gmail.com> <vangej$3harq$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 28 Aug 2024 18:23:32 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="cc8f51624d10978cb2cd26ba1ed55434";
logging-data="3721321"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/YLBtK/1LpLsym0C6E05CbJn1zGcS3YNc="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:AYfW63nytrK1U+lmRSwj+FpH8S4=
Content-Language: en-GB
In-Reply-To: <vangej$3harq$1@dont-email.me>
View all headers

On 28/08/2024 17:41, Bart wrote:
> On 28/08/2024 16:25, John Ames wrote:
>> On Wed, 28 Aug 2024 02:48:59 -0000 (UTC)
>> Sebastian <sebastian@here.com.invalid> wrote:
>>
>>> At my company, somebody tried to delete a method like method2() above,
>>> but forgot the last few lines (represented by call6()). This does
>>> not introduce a SyntaxError. Instead, call6() is now part of method1()
>>> because it's at the same level of indentation. In most programming
>>> languages, the beginning of method2() would be preceded by some
>>> delimiter marking the end of method1(), which would prevent an
>>> accidental merger of this type.
>>
>> (Waiting for the Python advocates to fire back with "well, don't do
>> that, then!" and completely miss the point that it's exactly the topic
>> of contention here that Python's scope-by-layout approach that makes it
>> easy to do that...)
>>
>
> Or they will say that whoever deleted method2 could also have deleted
> that 'end' line if one was used. Whilst also forgetting to delete
> method2's own 'end' line.
>
> Or maybe they deleted method2 plus both the preceding and succeeding
> lines so that method1 merges into method3.
>
> Generally, they might point all the ways that such oversights and all
> kinds of other typos can result in still-valid code in any language. But
> fragile syntax like Python's just makes it so easier to do that.
>

Having overly-large functions in any language is a risky way to code.
Deleting large chunks of a function is risky in any language. Failing
to have check in place (like automated tests) that catch the error
fairly quickly is also risky in any language.

But it is fair to say, I think, that Python's space-sensitive syntax
combined with limited static checking (even with tools like pylint) mean
you are more likely to be able to make a mistake that is not spotted
until later in testing, compared to languages with explicit block
delimiters.

And it is made worse by Python common practice of defining all methods
of a class inline in the class, leading to long stretches of code that
is all indented at least one tabstop. It is possible to add methods to
a class later on - optionally after giving a placeholder, but it is not
common practice (as far as I have seen) :

class A :
def __init__(self) :
self.x = 10
def foo(self) :
"Increment x"
self.x = self.x + 1
return self.x
def foobar(self) :
"Complicated action"
raise NotImplementedError

def A_foobar(self) :
self.x = self.x * 10
return self.x

A.foobar = A_foobar

(I'm sure a decorator could be used to make this slightly neater.)

Subject: Re: Python (was Re: I did not inhale)
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Wed, 28 Aug 2024 17:43 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 28 Aug 2024 17:43:44 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <vannkg$3ig72$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
<v9t204$2dofg$1@dont-email.me> <va28pi$3dldm$1@dont-email.me>
<va2ro9$3gd7v$1@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vak9k9$2ujrs$1@dont-email.me>
<valgpu$34s18$1@dont-email.me>
Content-Type: text/plain; charset=UTF-8
Injection-Date: Wed, 28 Aug 2024 19:43:44 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="d5d36a0746a3d5ad0cafe356b6bff1e4";
logging-data="3752162"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/1r0h6Jjo/a2/r17DF9bCD"
Cancel-Lock: sha1:wRyNVWYnFa/F+ZXIoje74fnAttI=
View all headers

On Tue, 27 Aug 2024 21:34:54 -0000 (UTC)
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>On Tue, 27 Aug 2024 11:26:18 +0100, Bart wrote:
>
>> (2) You want to temporarily comment out an 'if' line so that the
>> following block is unconditional. You can't do that with also
>> unindenting the block.
>
>In Emacs, I have commands defined to adjust the indentation of the
>selected region. Surely any other decent editor would offer the same.

Writing editor editor macros in order to work around fundamentally bad
language design is not something a programmer should have to waste time on.

Subject: Re: Python (was Re: I did not inhale)
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Wed, 28 Aug 2024 17:48 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 28 Aug 2024 17:48:57 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <vannu9$3ihae$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <v9t204$2dofg$1@dont-email.me>
<va28pi$3dldm$1@dont-email.me> <va2ro9$3gd7v$1@dont-email.me>
<va2vt0$3h3gj$1@dont-email.me> <va44rh$3p1l6$1@dont-email.me>
<va45eq$3pkt9$1@dont-email.me> <va4aut$3q4g0$1@dont-email.me>
<va4fbr$3qvij$1@dont-email.me> <va5108$3tmmd$1@dont-email.me>
<va51ok$3tqr9$1@dont-email.me> <va5ec2$3vluh$1@dont-email.me>
<va6q4g$c1a7$1@dont-email.me> <va6rpa$c6bg$1@dont-email.me>
<va6se9$cb8e$1@dont-email.me> <20240826083330.00004760@gmail.com>
<vaises$2k7o6$2@dont-email.me> <20240826155113.000005ba@gmail.com>
<wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vak9k9$2ujrs$1@dont-email.me>
<valgpu$34s18$1@dont-email.me>
<87y14hd4bk.fsf@nosuchdomain.example.com>
Content-Type: text/plain; charset=utf-8
Injection-Date: Wed, 28 Aug 2024 19:48:58 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="d5d36a0746a3d5ad0cafe356b6bff1e4";
logging-data="3753294"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Qol1qIHThu+1h+Z2dnjm9"
Cancel-Lock: sha1:g92dQUDFBlsPmnALqv7+t8hw7W4=
View all headers

On Tue, 27 Aug 2024 14:49:19 -0700
Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
>I do the same in Python. The difference is that in Python the
>indentation is the single source of truth about program structure,

Sadly.

>while in other languages it's a matter of convention.
>
>https://en.wikipedia.org/wiki/Single_source_of_truth

That reads like the sort of pseudo philosphical gasbagging beloved of a
certain type of ivory tower university lecturer who would probably last 2 days
in a commercial IT enviroment.

Subject: Re: Python (was Re: I did not inhale)
From: David Brown
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Wed, 28 Aug 2024 18:48 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 28 Aug 2024 20:48:08 +0200
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <vanrd8$3j0vv$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
<v9t204$2dofg$1@dont-email.me> <va28pi$3dldm$1@dont-email.me>
<va2ro9$3gd7v$1@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vak9k9$2ujrs$1@dont-email.me> <valgpu$34s18$1@dont-email.me>
<vannkg$3ig72$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 28 Aug 2024 20:48:09 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="cc8f51624d10978cb2cd26ba1ed55434";
logging-data="3769343"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19hi8Hj84LWykhhVvDgpzsUk+lvktBwecw="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:IXK73woeyZiTJdxDam51KtVNL5s=
Content-Language: en-GB
In-Reply-To: <vannkg$3ig72$1@dont-email.me>
View all headers

On 28/08/2024 19:43, Muttley@dastardlyhq.com wrote:
> On Tue, 27 Aug 2024 21:34:54 -0000 (UTC)
> Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>> On Tue, 27 Aug 2024 11:26:18 +0100, Bart wrote:
>>
>>> (2) You want to temporarily comment out an 'if' line so that the
>>> following block is unconditional. You can't do that with also
>>> unindenting the block.
>>
>> In Emacs, I have commands defined to adjust the indentation of the
>> selected region. Surely any other decent editor would offer the same.
>
> Writing editor editor macros in order to work around fundamentally bad
> language design is not something a programmer should have to waste time on.
>
>

I don't know about Emacs, but in most editors the way you indent a block
of code is to select the lines, then press "Tab". Unindenting is
"shift-Tab". Changing tabs to spaces or spaces to tabs is done by
selecting "Tabs to spaces" from the Edit menu, or something equally
simple and obvious. Many editor can be set to convert tabs to spaces
(or vice versa) when saving files, perhaps specific to the file type (so
you don't muck up your makefiles).

It takes a special kind of genius to be able to program, and yet still
have trouble with this kind of thing.

Subject: Re: Python (was Re: I did not inhale)
From: Bart
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Wed, 28 Aug 2024 19:27 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc@freeuk.com (Bart)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 28 Aug 2024 20:27:53 +0100
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <vantnp$3j94i$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
<v9t204$2dofg$1@dont-email.me> <va28pi$3dldm$1@dont-email.me>
<va2ro9$3gd7v$1@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vak9k9$2ujrs$1@dont-email.me> <valgpu$34s18$1@dont-email.me>
<vannkg$3ig72$1@dont-email.me> <vanrd8$3j0vv$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 28 Aug 2024 21:27:53 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="1407973ec3a2d1c19c9aff4f00a8367c";
logging-data="3777682"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/4iir6Lam01R1YH4EV6h8N"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:hhDBk6Q11y2D97LMVZQB8lw2ukg=
Content-Language: en-GB
In-Reply-To: <vanrd8$3j0vv$1@dont-email.me>
View all headers

On 28/08/2024 19:48, David Brown wrote:
> On 28/08/2024 19:43, Muttley@dastardlyhq.com wrote:
>> On Tue, 27 Aug 2024 21:34:54 -0000 (UTC)
>> Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>>> On Tue, 27 Aug 2024 11:26:18 +0100, Bart wrote:
>>>
>>>> (2) You want to temporarily comment out an 'if' line so that the
>>>> following block is unconditional. You can't do that with also
>>>> unindenting the block.
>>>
>>> In Emacs, I have commands defined to adjust the indentation of the
>>> selected region. Surely any other decent editor would offer the same.
>>
>> Writing editor editor macros in order to work around fundamentally bad
>> language design is not something a programmer should have to waste
>> time on.
>>
>>
>
> I don't know about Emacs, but in most editors the way you indent a block
> of code is to select the lines, then press "Tab".  Unindenting is
> "shift-Tab".  Changing tabs to spaces or spaces to tabs is done by
> selecting "Tabs to spaces" from the Edit menu, or something equally
> simple and obvious.  Many editor can be set to convert tabs to spaces
> (or vice versa) when saving files, perhaps specific to the file type (so
> you don't muck up your makefiles).
>
> It takes a special kind of genius to be able to program, and yet still
> have trouble with this kind of thing.

The main problem isn't in changing the indentation of a block of code;
it is in HAVING to do so because of poor language design. A lesser one
is having to rely on whatever varied features that 100s of different
editors may have to do so.

And yet another, of more significance, if that after you've indented a
block, it may now merge into an adjacent block that was already at that
new indent. If you later need to revert that first block back to it's
original position, you'd better make sure you mark that boundary.

It is a language design issue pure and simple. Don't try and pin it on
the users and make out it's due to lack of expertise with their editors.
Of course we can all indent blocks; it's just an unnecessary palaver.

Clearly your point of view is as a language /user/ where languages and
their characteristics are an invariant that you can't do anything about,
can't change, and need to work around.

But some of us devise (and, importanly, implement) languages of our own
and can be more vocal about misfeatures in others.

Subject: Re: Python (was Re: I did not inhale)
From: Keith Thompson
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: None to speak of
Date: Wed, 28 Aug 2024 20:29 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 28 Aug 2024 13:29:18 -0700
Organization: None to speak of
Lines: 33
Message-ID: <87ttf4bdcx.fsf@nosuchdomain.example.com>
References: <uu54la$3su5b$6@dont-email.me> <va44rh$3p1l6$1@dont-email.me>
<va45eq$3pkt9$1@dont-email.me> <va4aut$3q4g0$1@dont-email.me>
<va4fbr$3qvij$1@dont-email.me> <va5108$3tmmd$1@dont-email.me>
<va51ok$3tqr9$1@dont-email.me> <va5ec2$3vluh$1@dont-email.me>
<va6q4g$c1a7$1@dont-email.me> <va6rpa$c6bg$1@dont-email.me>
<va6se9$cb8e$1@dont-email.me> <20240826083330.00004760@gmail.com>
<vaises$2k7o6$2@dont-email.me> <20240826155113.000005ba@gmail.com>
<wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vak9k9$2ujrs$1@dont-email.me>
<valgpu$34s18$1@dont-email.me>
<87y14hd4bk.fsf@nosuchdomain.example.com>
<valnei$35rt8$2@dont-email.me>
<87ikvlcs7i.fsf@nosuchdomain.example.com>
<vamclm$3c4ke$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Wed, 28 Aug 2024 22:29:20 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="1017e97994ee365b6a0a4b9b05fc05d0";
logging-data="3779170"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ZmypyfrAJrj3mR6FvcvOa"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:NbH+xfRawrt7LmUaX2cIsbttcRo=
sha1:aG73BMJBIGsZlt9gup+1rbviKk8=
View all headers

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
> On Tue, 27 Aug 2024 19:10:57 -0700, Keith Thompson wrote:
>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>> On Tue, 27 Aug 2024 14:49:19 -0700, Keith Thompson wrote:
>>>> I've done some Python programming, and it wouldn't occur to me to add
>>>> "#end" comments. If I saw them in a code review I'd probably
>>>> recommend deleting them.
>>>
>>> Give them a try. They simplify a lot of situations. I already posted a
>>> reasonably complex example in this thread. Go have a look at it, and
>>> see what happens when you delete those comments.
>>
>> No, I won't be doing that.
>
> I wonder why? You expressed an opinion about them, yet when I try to find
> out more about why you feel that way, you run away.

I didn't intend to run away, I was just declining to engage.

But ok, I found your post and removed all the #end comments. I found it
just as readable without them as with them.

I'm very much aware that different people perceive things differently.
(An unrelated example: I find "Yoda conditions" like `if (42 == value)`
deeply annoying, but some people like them.) If #end comments help you,
I'm not going to tell you not to use them. But be aware that (a) other
readers might dislike them, and (b) if you're going to be reading Python
code written by others, you'll need to be able to get along without
them.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */

Subject: Re: Python (was Re: I did not inhale)
From: Keith Thompson
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: None to speak of
Date: Wed, 28 Aug 2024 20:37 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 28 Aug 2024 13:37:24 -0700
Organization: None to speak of
Lines: 62
Message-ID: <87le0gbczf.fsf@nosuchdomain.example.com>
References: <uu54la$3su5b$6@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com>
<wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vak9k9$2ujrs$1@dont-email.me>
<valgpu$34s18$1@dont-email.me> <vannkg$3ig72$1@dont-email.me>
<vanrd8$3j0vv$1@dont-email.me> <vantnp$3j94i$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 28 Aug 2024 22:37:27 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="1017e97994ee365b6a0a4b9b05fc05d0";
logging-data="3779170"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19cwvyWDQeQLwFqKNBSY8SR"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:UPbLMbU4GokjbiEF0Ofma4Qxob0=
sha1:0osHqcQTasLmbjcwMvUv+0lxZDM=
View all headers

Bart <bc@freeuk.com> writes:
> On 28/08/2024 19:48, David Brown wrote:
>> On 28/08/2024 19:43, Muttley@dastardlyhq.com wrote:
>>> On Tue, 27 Aug 2024 21:34:54 -0000 (UTC)
>>> Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>>>> On Tue, 27 Aug 2024 11:26:18 +0100, Bart wrote:
>>>>
>>>>> (2) You want to temporarily comment out an 'if' line so that the
>>>>> following block is unconditional. You can't do that with also
>>>>> unindenting the block.
>>>>
>>>> In Emacs, I have commands defined to adjust the indentation of the
>>>> selected region. Surely any other decent editor would offer the same.
>>>
>>> Writing editor editor macros in order to work around fundamentally bad
>>> language design is not something a programmer should have to waste
>>> time on.
>>>
>>>
>> I don't know about Emacs, but in most editors the way you indent a
>> block of code is to select the lines, then press "Tab".  Unindenting
>> is "shift-Tab".  Changing tabs to spaces or spaces to tabs is done
>> by selecting "Tabs to spaces" from the Edit menu, or something
>> equally simple and obvious.  Many editor can be set to convert tabs
>> to spaces (or vice versa) when saving files, perhaps specific to the
>> file type (so you don't muck up your makefiles).
>> It takes a special kind of genius to be able to program, and yet
>> still have trouble with this kind of thing.
>
> The main problem isn't in changing the indentation of a block of code;
> it is in HAVING to do so because of poor language design. A lesser one
> is having to rely on whatever varied features that 100s of different
> editors may have to do so.
>
> And yet another, of more significance, if that after you've indented a
> block, it may now merge into an adjacent block that was already at
> that new indent. If you later need to revert that first block back to
> it's original position, you'd better make sure you mark that boundary.
>
> It is a language design issue pure and simple. Don't try and pin it on
> the users and make out it's due to lack of expertise with their
> editors. Of course we can all indent blocks; it's just an unnecessary
> palaver.
>
> Clearly your point of view is as a language /user/ where languages and
> their characteristics are an invariant that you can't do anything
> about, can't change, and need to work around.
>
> But some of us devise (and, importanly, implement) languages of our
> own and can be more vocal about misfeatures in others.

If I'm moving chunks of code around in a C or C++ program, from one
scope to another, I can get away with leaving the indentation as it is,
because all the compiler cares about is where the braces are. But I
*always* adjust the indentation to fit the code's new context.

Python's use of indentation to indicate scoping just means that I have
to do what I would have done anyway.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */

Subject: Re: Python (was Re: I did not inhale)
From: Bart
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Wed, 28 Aug 2024 20:44 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc@freeuk.com (Bart)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 28 Aug 2024 21:44:56 +0100
Organization: A noiseless patient Spider
Lines: 72
Message-ID: <vao288$3k01j$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vak9k9$2ujrs$1@dont-email.me> <valgpu$34s18$1@dont-email.me>
<vannkg$3ig72$1@dont-email.me> <vanrd8$3j0vv$1@dont-email.me>
<vantnp$3j94i$1@dont-email.me> <87le0gbczf.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 28 Aug 2024 22:44:57 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="1407973ec3a2d1c19c9aff4f00a8367c";
logging-data="3801139"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX191y55pkuh0ceoyh+tynH7X"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:tw2oMOT8xQn77DQ65jsub/Yq21E=
In-Reply-To: <87le0gbczf.fsf@nosuchdomain.example.com>
Content-Language: en-GB
View all headers

On 28/08/2024 21:37, Keith Thompson wrote:
> Bart <bc@freeuk.com> writes:
>> On 28/08/2024 19:48, David Brown wrote:
>>> On 28/08/2024 19:43, Muttley@dastardlyhq.com wrote:
>>>> On Tue, 27 Aug 2024 21:34:54 -0000 (UTC)
>>>> Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>>>>> On Tue, 27 Aug 2024 11:26:18 +0100, Bart wrote:
>>>>>
>>>>>> (2) You want to temporarily comment out an 'if' line so that the
>>>>>> following block is unconditional. You can't do that with also
>>>>>> unindenting the block.
>>>>>
>>>>> In Emacs, I have commands defined to adjust the indentation of the
>>>>> selected region. Surely any other decent editor would offer the same.
>>>>
>>>> Writing editor editor macros in order to work around fundamentally bad
>>>> language design is not something a programmer should have to waste
>>>> time on.
>>>>
>>>>
>>> I don't know about Emacs, but in most editors the way you indent a
>>> block of code is to select the lines, then press "Tab".  Unindenting
>>> is "shift-Tab".  Changing tabs to spaces or spaces to tabs is done
>>> by selecting "Tabs to spaces" from the Edit menu, or something
>>> equally simple and obvious.  Many editor can be set to convert tabs
>>> to spaces (or vice versa) when saving files, perhaps specific to the
>>> file type (so you don't muck up your makefiles).
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 28 Aug 2024 21:44:56 +0100
Organization: A noiseless patient Spider
Lines: 72
Message-ID: <vao288$3k01j$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
>>> It takes a special kind of genius to be able to program, and yet
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
>>> still have trouble with this kind of thing.
>>
>> The main problem isn't in changing the indentation of a block of code;
>> it is in HAVING to do so because of poor language design. A lesser one
>> is having to rely on whatever varied features that 100s of different
>> editors may have to do so.
>>
>> And yet another, of more significance, if that after you've indented a
>> block, it may now merge into an adjacent block that was already at
>> that new indent. If you later need to revert that first block back to
>> it's original position, you'd better make sure you mark that boundary.
>>
>> It is a language design issue pure and simple. Don't try and pin it on
>> the users and make out it's due to lack of expertise with their
>> editors. Of course we can all indent blocks; it's just an unnecessary
>> palaver.
>>
>> Clearly your point of view is as a language /user/ where languages and
>> their characteristics are an invariant that you can't do anything
>> about, can't change, and need to work around.
>>
>> But some of us devise (and, importanly, implement) languages of our
>> own and can be more vocal about misfeatures in others.
>
> If I'm moving chunks of code around in a C or C++ program, from one
> scope to another, I can get away with leaving the indentation as it is,
> because all the compiler cares about is where the braces are. But I
> *always* adjust the indentation to fit the code's new context.
>
> Python's use of indentation to indicate scoping just means that I have
> to do what I would have done anyway.

If you glance at the top you will see that my original example involved
/temparily/ commenting out the 'if' part of a conditional block. Another
example was in temporarily /adding/ an 'if' around a block. And yet
another (you might want to see my original longer post) was in adding in
temporary code but deliberately not using the right indent to make it
more visible.

You don't want to waste time getting the layout exactly right and then
also risk that block disappearing into neighbouring code because
everything is now at the same indent level.

Subject: Re: Python (was Re: I did not inhale)
From: Andy Walker
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: Not very much
Date: Wed, 28 Aug 2024 22:07 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: anw@cuboid.co.uk (Andy Walker)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 28 Aug 2024 23:07:11 +0100
Organization: Not very much
Lines: 93
Message-ID: <vao72f$3dhv9$2@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
<v9t204$2dofg$1@dont-email.me> <va28pi$3dldm$1@dont-email.me>
<va2ro9$3gd7v$1@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vak9k9$2ujrs$1@dont-email.me> <vakj7g$303sh$1@dont-email.me>
<vakn87$30oaf$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 29 Aug 2024 00:07:12 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="997ea9d52d19a9d48b1b147c3f20c54d";
logging-data="3590121"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+v9Ob38JyMy6qk8nyga2mZ"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:fQXGs3HLKFWtWllwSuLALxjK/Xg=
Content-Language: en-GB
In-Reply-To: <vakn87$30oaf$1@dont-email.me>
View all headers

On 27/08/2024 15:18, Bart wrote:
[Previous discussion and code snipped -- ANW]
> This was an attempt to port an benchmark into Nim; I'd spent the
> best part of an hour trying to get it right, but it kept going
> wrong. In the end I resorted to artificial block terminators.
> The final code looked like that below. Now it is much, much easier
> to see what goes where, and what belongs to what. I can more
> confidently write that extra statement following the opening 'if'.
> With these changes, the porting went much more smooothly.
>         if q1!=1:
>             for i in countup(2,n):
>                 q[i]=p[i]
> #           end
>             flips=1
>             while true:
>                 qq=q[q1]
>                 if qq==1:
>                     sum+=sign*flips
>                     if flips>maxflips:
>                         maxflips=flips
> #                   end
>                     break
> #               end
>                 q[q1]=q1
>                 if q1>=4:
>                     i=2
>                     j=q1-1
>                     while true:
>                         t=q[i]
>                         q[i]=q[j]
>                         q[j]=t
>                         i+=1
>                         j-=1
>                         if i>=j:
>                             break
> #                       end
> #                   end
> #               end
>                 q1=qq
>                 flips+=1
> #           end
> #       end
> Sure, people CAN program in such languages, but it is harder work> and more error prone.

ISTM that the difficulty in reading and writing code like that
stems not from the indentation, but
from a
long narrow
corridor
of program
which is
difficult to
read
and write
no matter how
it is indented.
Variable indentation
merely
makes the long
column wriggly.
It reminds me of the early autocodes, before the days of block structure.
I don't know Nim [and only a little of Python], so I can't apportion the
difficulty of understanding the code between the language and the chosen
programming style. But I can't resist adding a few comments:

(a) Bart takes 14 lines [from "if q1>=4" to the corresponding "# end"]
to express the notion [E&OE]

for i from 2 to q1%2
swap (q[i], q[q1 - i + 1])

Small wonder that he found the code hard to get right!

(b) There are two occurrences of "while true" and two of "break" in the
code which would not be necessary or appropriate in C or Algol [amongst
others]. Again, IMO these contribute to the obscurity of the code.

(c) I recognise that code as coming from a version of the "Fannkuch"
benchmark, so I already have it in C and in Algol 68G. Bart's Nim code
is substantially longer [around twice the length of the A68G]. Brevity
is not everything, but if you are forever scrolling from one window to
the next while your friend gets it all into one window [without losing
clarity of expression], then guess who is going to find it easier to
read, write and understand the code.

(d) Further, if the code is harder to understand, it has more need of
explanatory comments, which in turn make the code longer, so harder to
navigate around.

--
Andy Walker, Nottingham.
Andy's music pages: www.cuboid.me.uk/andy/Music
Composer of the day: www.cuboid.me.uk/andy/Music/Composers/Hertel

Subject: Re: Python (was Re: I did not inhale)
From: Lawrence D'Oliv
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Wed, 28 Aug 2024 22:49 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 28 Aug 2024 22:49:04 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <vao9h0$3l470$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
<v9t204$2dofg$1@dont-email.me> <va28pi$3dldm$1@dont-email.me>
<va2ro9$3gd7v$1@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vak9k9$2ujrs$1@dont-email.me> <valgpu$34s18$1@dont-email.me>
<vannkg$3ig72$1@dont-email.me> <vanrd8$3j0vv$1@dont-email.me>
<vantnp$3j94i$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 29 Aug 2024 00:49:04 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a3e0b73fdd7ebf903f98fecca6ec3d09";
logging-data="3838176"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+YHhcRbvGCKDgpC5JrepO1"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:MT0y7U9iPI3VRBsRdA58BweXt44=
View all headers

On Wed, 28 Aug 2024 20:27:53 +0100, Bart wrote:

> The main problem isn't in changing the indentation of a block of code;
> it is in HAVING to do so because of poor language design.

If you think the need for refactoring is something that can be solved by
“language design”, I’d like to hear how.

Subject: Re: Python (was Re: I did not inhale)
From: Lawrence D'Oliv
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Wed, 28 Aug 2024 22:49 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 28 Aug 2024 22:49:55 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <vao9ii$3l470$2@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <va5108$3tmmd$1@dont-email.me>
<va51ok$3tqr9$1@dont-email.me> <va5ec2$3vluh$1@dont-email.me>
<va6q4g$c1a7$1@dont-email.me> <va6rpa$c6bg$1@dont-email.me>
<va6se9$cb8e$1@dont-email.me> <20240826083330.00004760@gmail.com>
<vaises$2k7o6$2@dont-email.me> <20240826155113.000005ba@gmail.com>
<wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vak9k9$2ujrs$1@dont-email.me>
<vakj7g$303sh$1@dont-email.me> <20240827080320.00003fd2@gmail.com>
<val6u3$33e82$1@dont-email.me> <vam4v9$3avsi$3@dont-email.me>
<vamv4k$3eo1d$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 29 Aug 2024 00:49:55 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a3e0b73fdd7ebf903f98fecca6ec3d09";
logging-data="3838176"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19yQmFs/hgGbqugGiU/jrUb"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:BCrBwbXJlXth/s+lPTYURUQW8e8=
View all headers

On Wed, 28 Aug 2024 12:45:40 +0200, David Brown wrote:

> If you have some code that needs a lot of documentation (and some does),
> then put the comments in a place that does not interfere with reading
> and understanding the code.

Put them next to the code they’re helping you read and understand.

Subject: Re: Python (was Re: I did not inhale)
From: Lawrence D'Oliv
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Wed, 28 Aug 2024 23:02 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 28 Aug 2024 23:02:45 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 70
Message-ID: <vaoaak$3l470$3@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <va44rh$3p1l6$1@dont-email.me>
<va45eq$3pkt9$1@dont-email.me> <va4aut$3q4g0$1@dont-email.me>
<va4fbr$3qvij$1@dont-email.me> <va5108$3tmmd$1@dont-email.me>
<va51ok$3tqr9$1@dont-email.me> <va5ec2$3vluh$1@dont-email.me>
<va6q4g$c1a7$1@dont-email.me> <va6rpa$c6bg$1@dont-email.me>
<va6se9$cb8e$1@dont-email.me> <20240826083330.00004760@gmail.com>
<vaises$2k7o6$2@dont-email.me> <20240826155113.000005ba@gmail.com>
<wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vak9k9$2ujrs$1@dont-email.me>
<valgpu$34s18$1@dont-email.me> <87y14hd4bk.fsf@nosuchdomain.example.com>
<valnei$35rt8$2@dont-email.me> <87ikvlcs7i.fsf@nosuchdomain.example.com>
<vamclm$3c4ke$1@dont-email.me> <87ttf4bdcx.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 29 Aug 2024 01:02:45 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a3e0b73fdd7ebf903f98fecca6ec3d09";
logging-data="3838176"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Ov4qXDy+i6GsxKmB8rF5g"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:ecTSqxIPxdsBKnPGFbyUohkDirc=
View all headers

On Wed, 28 Aug 2024 13:29:18 -0700, Keith Thompson wrote:

> But ok, I found your post and removed all the #end comments. I found it
> just as readable without them as with them.

You know what? You are right. That example was just too
well-structured.

Here’s a more dangerous one:

def register_additional_standard(self, **kwargs) :
"registers additional standard interfaces that are not automatically" \
" installed at Connection creation time. Currently the only one is" \
" the object-manager interface, registered with\n" \
"\n" \
" «conn».register_additional_standard(managed_objects = True)\n"
for key in kwargs :
if kwargs[key] :
if key == "managed_objects" :
if self._managed_objects != None :
raise asyncio.InvalidStateError \
(
"object manager interface already registered"
)
#end if
self.register \
(
path = "/",
interface = ManagedObjectsHandler(),
fallback = True
)
self._managed_objects = {}
else :
raise TypeError("unrecognized argument keyword “%s”" % key)
#end if
#end if
#end for
return \
self
#end register_additional_standard

versus

def register_additional_standard(self, **kwargs) :
"registers additional standard interfaces that are not automatically" \
" installed at Connection creation time. Currently the only one is" \
" the object-manager interface, registered with\n" \
"\n" \
" «conn».register_additional_standard(managed_objects = True)\n"
for key in kwargs :
if kwargs[key] :
if key == "managed_objects" :
if self._managed_objects != None :
raise asyncio.InvalidStateError \
(
"object manager interface already registered"
)
self.register \
(
path = "/",
interface = ManagedObjectsHandler(),
fallback = True
)
self._managed_objects = {}
else :
raise TypeError("unrecognized argument keyword “%s”" % key)
return self

I was looking for quite a tricky example I remember seeing on the
ArjanCodes channel on YouTube, but I can’t find it.

Pages:12345678910

rocksolid light 0.9.8
clearnet tor