Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #8: static buildup


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: Dmitry A. Kazakov
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Sun, 25 Aug 2024 10:32 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: mailbox@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Sun, 25 Aug 2024 12:32:10 +0200
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <vaf179$1rnhl$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <87il0lldf8.fsf@tudado.org>
<choices-20240413123957@ram.dialup.fu-berlin.de>
<v9lm2k$12qhv$1@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
<v9posc$1rpdj$1@dont-email.me> <v9pvoo$1sn55$1@dont-email.me>
<v9r60h$2289h$2@dont-email.me> <v9sa91$2afht$1@dont-email.me>
<v9sbf4$2artq$1@dont-email.me> <v9shqt$2bn73$1@dont-email.me>
<v9t4vm$2eg9b$1@dont-email.me> <v9t6jg$2e96d$1@dont-email.me>
<vaennp$1q5l3$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 25 Aug 2024 12:32:10 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f5a2c57f6b4691eb2d4d7d00ff1770a2";
logging-data="1957429"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX189GHvAdHZIrpum/s8CNIUik52vE5FSxyc="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:37WRGGsu8Ao+Ox/uuMwg9ImEync=
Content-Language: en-US
In-Reply-To: <vaennp$1q5l3$2@dont-email.me>
View all headers

On 2024-08-25 09:50, Sebastian wrote:
> In comp.unix.programmer Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
>> Windows did many things wrong, but accessing file descriptors by numbers
>> is beyond even Windows. In Windows a file is an OS object. You access it
>> getting an opaque handle to. Note that a handle can be marshaled from
>> one process to another. Try that with process-local numbers!
>
> UNIX domain sockets support the passing of file descriptors between
> processes.

File descriptor (a pointer to) is not file number.

You cannot pass number 1 simply because 1 is already in use.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Subject: Re: Python (was Re: I did not inhale)
From: vallor
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Sun, 25 Aug 2024 13: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!.POSTED!not-for-mail
From: vallor@cultnix.org (vallor)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Sun, 25 Aug 2024 13:41:50 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <vafcau$1st8a$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <87il0lldf8.fsf@tudado.org>
<choices-20240413123957@ram.dialup.fu-berlin.de>
<v9lm2k$12qhv$1@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
<v9posc$1rpdj$1@dont-email.me> <v9pvoo$1sn55$1@dont-email.me>
<v9r60h$2289h$2@dont-email.me> <v9sa91$2afht$1@dont-email.me>
<v9sbf4$2artq$1@dont-email.me> <v9shqt$2bn73$1@dont-email.me>
<v9t4vm$2eg9b$1@dont-email.me> <v9t6jg$2e96d$1@dont-email.me>
<vaennp$1q5l3$2@dont-email.me> <vaf179$1rnhl$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 25 Aug 2024 15:41:51 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="28f6d5a3a73146dcec7aae3d6bd3dd5c";
logging-data="1996042"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18C/ZUqI+cksp2AtSvtgCjU"
User-Agent: Pan/0.160 (Toresk; 7830f38; Linux-6.11.0-rc5)
Cancel-Lock: sha1:tjvUNyaFkZXFvwtB2Df0JD5U7dM=
X-Face: \}2`P"_@pS86<'EM:'b.Ml}8IuMK"pV"?FReF$'c.S%u9<Q#U*4QO)$l81M`{Q/n
XL'`91kd%N::LG:=*\35JS0prp\VJN^<s"b#bff@fA7]5lJA.jn,x_d%Md$,{.EZ
View all headers

On Sun, 25 Aug 2024 12:32:10 +0200, "Dmitry A. Kazakov"
<mailbox@dmitry-kazakov.de> wrote in <vaf179$1rnhl$1@dont-email.me>:

> On 2024-08-25 09:50, Sebastian wrote:
>> In comp.unix.programmer Dmitry A. Kazakov <mailbox@dmitry-kazakov.de>
>> wrote:
>>> Windows did many things wrong, but accessing file descriptors by
>>> numbers is beyond even Windows. In Windows a file is an OS object. You
>>> access it getting an opaque handle to. Note that a handle can be
>>> marshaled from one process to another. Try that with process-local
>>> numbers!
>>
>> UNIX domain sockets support the passing of file descriptors between
>> processes.
>
> File descriptor (a pointer to) is not file number.
>
> You cannot pass number 1 simply because 1 is already in use.

On this Linux system, "man 7 unix", in the section
"SCM_RIGHTS", it explains how the passing mechanism
is handled. One paragraph reads:

Commonly, this operation is referred to as "passing a
file descriptor" to another process. However, more
accurately, what is being passed is a reference to an
open file description (see open(2)), and in the re‐
ceiving process it is likely that a different file de‐
scriptor number will be used. Semantically, this op‐
eration is equivalent to duplicating (dup(2)) a file
descriptor into the file descriptor table of another
process.

--
-v

Subject: Re: Python (was Re: I did not inhale)
From: Nuno Silva
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Sun, 25 Aug 2024 15:32 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nunojsilva@invalid.invalid (Nuno Silva)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Sun, 25 Aug 2024 16:32:04 +0100
Organization: A noiseless patient Spider
Lines: 54
Message-ID: <vafipo$1t54v$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <uvbfii$3mom0$1@news.xmission.com>
<20240412094809.811@kylheku.com> <87il0mm94y.fsf@tudado.org>
<way-20240413091747@ram.dialup.fu-berlin.de>
<87il0lldf8.fsf@tudado.org>
<choices-20240413123957@ram.dialup.fu-berlin.de>
<v9lm2k$12qhv$1@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>
<va44tt$3piki$1@dont-email.me> <va4b87$3q4g0$3@dont-email.me>
<20240821083739.00001553@gmail.com> <va5eie$3vluh$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Sun, 25 Aug 2024 17:32:09 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="156ab3bd85ae67fe282e3aecf9a0b621";
logging-data="2004127"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+PxExHo2gq2qV84TWUQk65"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
Cancel-Lock: sha1:eQ1WdM3dc9/ITDy04rKIO6CfQaU=
View all headers

(Note: I'm not setting Followup-To since I don't know where the
participants are reading this, but do note that I'm only subscribed to
comp.unix.programmer. I will probably subscribe to .shell soon, though.)

On 2024-08-21, David Brown wrote:

> On 21/08/2024 17:37, John Ames wrote:
>> Yes, books can be wrong, and yes, community fora can have valuable
>> information - but there really is no substitute for a good manual, in
>> print or otherwise. StackOverflow is very useful for clearing up some
>> kinds of esoteric-yet-common questions, but if you just need to double-
>> check what the legal values for parameter X in function Y are, it's
>> much quicker (and usually less error-prone) to turn to a reference
>> guide than it is to go poking around looking for records of times in
>> history where someone else might've had the same question.
>>
>> (Doubly so, now that Google is as friggin' useless as it's gotten the
>> last few years.)
>>
>
> I do like a good manual, whether it be a physical book or an online
> manual. So I am not objecting to reading them, learning from them, or
> using them as references.

I'd say the online manual can be useful as a reference, at least in my
experience with Linux programming. It also has some information on
POSIX. And is local, so can be used even in the absence of a network
connection of any sort.

Do people feel differently about online manuals on other systems? Or are
these usually good to be used as a reference? (Asking out of curiosity,
as I don't have much experience yet coding on environments other than
"GNU/Linux".)

> I am just objecting to the concept that reading particular books is
> somehow "required" in order to write "useful C" or "program for
> Linux". They are neither necessary nor sufficient, especially when
> picking one or two particular books.

But once you start pointing out that there are bad books, doesn't that
also imply that people commenting on which books they found good is
useful, so that one can have an idea of which books to avoid or prefer,
even if some comments end up being subjective to some extent?

(But yes, it might well be the case that someone just can't work so well
with a book as a medium and prefers some other approach. A lot of people
these days are sharing youtube videos as "tutorials" and that's
something I can't easily "consume", so I can kind of imagine what that'd
be like. - Now if only Google had a GET parameter in the web (not video)
search for "do not provide video results. ever."...)

--
Nuno Silva

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: Sun, 25 Aug 2024 16:41 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
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: Sun, 25 Aug 2024 18:41:21 +0200
Organization: A noiseless patient Spider
Lines: 83
Message-ID: <vafmrh$1vs20$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <uvbfii$3mom0$1@news.xmission.com>
<20240412094809.811@kylheku.com> <87il0mm94y.fsf@tudado.org>
<way-20240413091747@ram.dialup.fu-berlin.de> <87il0lldf8.fsf@tudado.org>
<choices-20240413123957@ram.dialup.fu-berlin.de>
<v9lm2k$12qhv$1@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>
<va44tt$3piki$1@dont-email.me> <va4b87$3q4g0$3@dont-email.me>
<20240821083739.00001553@gmail.com> <va5eie$3vluh$2@dont-email.me>
<vafipo$1t54v$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 25 Aug 2024 18:41:22 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="57cdba51789b595ebde6070eebd9ccbd";
logging-data="2093120"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18zvDtdAKeheQl3m8InlnvjzpMGJ2l3kwg="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:dbitmaBHg+W66TS8livv1dunock=
Content-Language: en-GB
In-Reply-To: <vafipo$1t54v$1@dont-email.me>
View all headers

On 25/08/2024 17:32, Nuno Silva wrote:
> (Note: I'm not setting Followup-To since I don't know where the
> participants are reading this, but do note that I'm only subscribed to
> comp.unix.programmer. I will probably subscribe to .shell soon, though.)
>
>
> On 2024-08-21, David Brown wrote:
>
>> On 21/08/2024 17:37, John Ames wrote:
>>> Yes, books can be wrong, and yes, community fora can have valuable
>>> information - but there really is no substitute for a good manual, in
>>> print or otherwise. StackOverflow is very useful for clearing up some
>>> kinds of esoteric-yet-common questions, but if you just need to double-
>>> check what the legal values for parameter X in function Y are, it's
>>> much quicker (and usually less error-prone) to turn to a reference
>>> guide than it is to go poking around looking for records of times in
>>> history where someone else might've had the same question.
>>>
>>> (Doubly so, now that Google is as friggin' useless as it's gotten the
>>> last few years.)
>>>
>>
>> I do like a good manual, whether it be a physical book or an online
>> manual. So I am not objecting to reading them, learning from them, or
>> using them as references.
>
> I'd say the online manual can be useful as a reference, at least in my
> experience with Linux programming. It also has some information on
> POSIX. And is local, so can be used even in the absence of a network
> connection of any sort.
>

Reference manuals relevant to the topic are, of course, extremely
helpful to most people - whether they are physical manuals or online.
But the key point is the /relevance/. My argument is not that books or
manuals are unnecessary, merely that there are no universally required
or essential references or topics. And you certainly don't need to read
through an entire reference to have use of it.

> Do people feel differently about online manuals on other systems? Or are
> these usually good to be used as a reference? (Asking out of curiosity,
> as I don't have much experience yet coding on environments other than
> "GNU/Linux".)
>

For many programming languages or major libraries or toolkits, there are
"official" online references, manuals or documentation, and these can
often be valuable sources of information. Often they are not at all
suitable for reading through as a whole, and are no substitute for
tutorials, courses, or other learning material.

>> I am just objecting to the concept that reading particular books is
>> somehow "required" in order to write "useful C" or "program for
>> Linux". They are neither necessary nor sufficient, especially when
>> picking one or two particular books.
>
> But once you start pointing out that there are bad books, doesn't that
> also imply that people commenting on which books they found good is
> useful, so that one can have an idea of which books to avoid or prefer,
> even if some comments end up being subjective to some extent?
>

Sure. It's fine - and possibly helpful - for someone to say "I liked
this book". It's even more helpful to have some details, such as "it
was good for me because I was already an experienced programmer in
languages X, Y and Z" or "it was good for me as a complete newbie who
had to take things slowly". What is almost never helpful, is someone
claiming that you /must/ read this book or that it is somehow
objectively the "best".

> (But yes, it might well be the case that someone just can't work so well
> with a book as a medium and prefers some other approach. A lot of people
> these days are sharing youtube videos as "tutorials" and that's
> something I can't easily "consume", so I can kind of imagine what that'd
> be like. - Now if only Google had a GET parameter in the web (not video)
> search for "do not provide video results. ever."...)
>

I think videos are a better medium than books for some things and some
people, and vice versa. As I mentioned before, there are a great many
different ways to learn (and to reference details later). The "best"
choice at any given time depends on a large number of factors.

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: Sun, 25 Aug 2024 21:59 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
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: Sun, 25 Aug 2024 21:59:18 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <vag9fm$23hhf$4@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <uvbfii$3mom0$1@news.xmission.com>
<20240412094809.811@kylheku.com> <87il0mm94y.fsf@tudado.org>
<way-20240413091747@ram.dialup.fu-berlin.de> <87il0lldf8.fsf@tudado.org>
<choices-20240413123957@ram.dialup.fu-berlin.de>
<v9lm2k$12qhv$1@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>
<va44tt$3piki$1@dont-email.me> <va4b87$3q4g0$3@dont-email.me>
<20240821083739.00001553@gmail.com> <va5eie$3vluh$2@dont-email.me>
<vafipo$1t54v$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 25 Aug 2024 23:59:18 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="34188c213084fda325f5b7302b43292b";
logging-data="2213423"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19xsXO6NS55EIAFCnKh+iRP"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:guNie4BJfxRNjiWvdADZ1krxLww=
View all headers

On Sun, 25 Aug 2024 16:32:04 +0100, Nuno Silva wrote:

> Do people feel differently about online manuals on other systems?

I decided about 20 years ago that, if I were going to have printed manuals
for all the material I have to know, I’d need a whole extra room in my
house just to hold it all.

Also, paper books related to computers start falling out of date from the
moment they’re published, or even before.

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: Sun, 25 Aug 2024 22:00 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: Sun, 25 Aug 2024 22:00:41 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <vag9i9$23hhf$5@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <87il0lldf8.fsf@tudado.org>
<choices-20240413123957@ram.dialup.fu-berlin.de>
<v9lm2k$12qhv$1@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
<v9posc$1rpdj$1@dont-email.me> <v9pvoo$1sn55$1@dont-email.me>
<v9r60h$2289h$2@dont-email.me> <v9sa91$2afht$1@dont-email.me>
<v9sbf4$2artq$1@dont-email.me> <v9shqt$2bn73$1@dont-email.me>
<v9t4vm$2eg9b$1@dont-email.me> <v9t6jg$2e96d$1@dont-email.me>
<vaennp$1q5l3$2@dont-email.me> <vaf179$1rnhl$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 26 Aug 2024 00:00:41 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="eec8a5f8880ec9ebcfea2c2354da2438";
logging-data="2213423"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18FPB7R7xcbskJAxd33sVx6"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:jH6/12iQhcs1EIdyRLC5dqPgXsg=
View all headers

On Sun, 25 Aug 2024 12:32:10 +0200, Dmitry A. Kazakov wrote:

> On 2024-08-25 09:50, Sebastian wrote:
>
>> In comp.unix.programmer Dmitry A. Kazakov <mailbox@dmitry-kazakov.de>
>> wrote:
>>>
>>> Windows did many things wrong, but accessing file descriptors by
>>> numbers is beyond even Windows. In Windows a file is an OS object. You
>>> access it getting an opaque handle to. Note that a handle can be
>>> marshaled from one process to another. Try that with process-local
>>> numbers!
>>
>> UNIX domain sockets support the passing of file descriptors between
>> processes.
>
> File descriptor (a pointer to) is not file number.
>
> You cannot pass number 1 simply because 1 is already in use.

You implied above that “accessing descriptors by numbers” is somehow a bad
thing, then when it is pointed out that *nix doesn’t actually work that
way, you somehow insist that is a drawback as well.

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: Sun, 25 Aug 2024 22:02 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: 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: Sun, 25 Aug 2024 22:02:56 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <vag9mg$23hhf$6@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <87il0lldf8.fsf@tudado.org>
<choices-20240413123957@ram.dialup.fu-berlin.de>
<v9lm2k$12qhv$1@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
<v9posc$1rpdj$1@dont-email.me> <v9pvoo$1sn55$1@dont-email.me>
<v9r60h$2289h$2@dont-email.me> <v9sa91$2afht$1@dont-email.me>
<v9sbf4$2artq$1@dont-email.me> <v9shqt$2bn73$1@dont-email.me>
<v9t4vm$2eg9b$1@dont-email.me> <v9t6jg$2e96d$1@dont-email.me>
<vaennp$1q5l3$2@dont-email.me> <vaf179$1rnhl$1@dont-email.me>
<vafcau$1st8a$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 26 Aug 2024 00:02:56 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="eec8a5f8880ec9ebcfea2c2354da2438";
logging-data="2213423"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18oodzkyLNs5vESHUKMrOnD"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:36SB9DRGQLP/+TbC84+yvBkcDGA=
View all headers

On Sun, 25 Aug 2024 13:41:50 -0000 (UTC), vallor wrote:

> On this Linux system, "man 7 unix", in the section "SCM_RIGHTS", it
> explains how the passing mechanism is handled. One paragraph reads:
>
> Commonly, this operation is referred to as "passing a
> file descriptor" to another process. However, more
> accurately, what is being passed is a reference to an
> open file description (see open(2)), and in the re‐
> ceiving process it is likely that a different file de‐
> scriptor number will be used.

Note the distinction between “file description” (the in-kernel data
structure that stores the context about the open file), and “file
descriptor” (the userland reference to the file description).

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: Mon, 26 Aug 2024 15:33 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: 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: Mon, 26 Aug 2024 08:33:30 -0700
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <20240826083330.00004760@gmail.com>
References: <uu54la$3su5b$6@dont-email.me>
<uvbfii$3mom0$1@news.xmission.com>
<20240412094809.811@kylheku.com>
<87il0mm94y.fsf@tudado.org>
<way-20240413091747@ram.dialup.fu-berlin.de>
<87il0lldf8.fsf@tudado.org>
<choices-20240413123957@ram.dialup.fu-berlin.de>
<v9lm2k$12qhv$1@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>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 26 Aug 2024 17:33:34 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="4e9d26d613202949cd593c47dd0f5943";
logging-data="2645330"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19NoUoqj+GQgEoMN/Y2XdKoFiWICKXsd3c="
Cancel-Lock: sha1:2twK/Ztg0YxtJ8CCvaVe1wBS9QU=
X-Newsreader: Claws Mail 4.2.0 (GTK 3.24.38; x86_64-w64-mingw32)
View all headers

On Thu, 22 Aug 2024 08:21:29 -0000 (UTC)
Muttley@dastardlyhq.com wrote:

> >I am a big fan of clear and consistent layout and indentation, which
> >is forced on you by Python (and Occam), but I too prefer explicit
> >blocking.
> > It's harder to get things wrong with explicit blocking, and you
> > are
>
> Indeed. You delete a bracket by mistake and it won't compile, end of.
> In Python you can delete a spaces/tabs by mistake and if its at the
> end of the block the thing could still run.
>
> >never faced with space vs. tab conflicts causing semantic changes to
> >the code.
>
> Yes, this is a royal PITA. I use tabs as in vim I can instantly
> change the indentation using "set ts=". With spaces its fixed short
> of dicking about with macros.

All of this. Are there some safeguards in place for the most egregious
cases? Yes - but literal whitespace is still a horrendous misfeature,
something the world at large has known for so long that it was already
an established joke by the time Ed Post was cracking wise about JCL in
freakin' _Datamation._

Python is far from the worst language out there - in fact, it's quite
usable for a wide variety of applications, in spite of that - but the
simple fact that Guido & co. made a boneheaded choice like that is the
reason I'll never be able to *respect* it, even when I do find myself
using it. There should - plain and simple - *never* be a time where you
can end up with unexpected semantic behavior because of settings in
your editor-of-choice.

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: Mon, 26 Aug 2024 17:59 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: Muttley@dastardlyhq.com
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Mon, 26 Aug 2024 17:59:25 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <vaifpt$2ic7g$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me>
<uvbfii$3mom0$1@news.xmission.com>
<20240412094809.811@kylheku.com>
<87il0mm94y.fsf@tudado.org>
<way-20240413091747@ram.dialup.fu-berlin.de>
<87il0lldf8.fsf@tudado.org>
<choices-20240413123957@ram.dialup.fu-berlin.de>
<v9lm2k$12qhv$1@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>
Content-Type: text/plain; charset=US-ASCII
Injection-Date: Mon, 26 Aug 2024 19:59:26 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="cbddd853a004bc0784a922fc673ff628";
logging-data="2699504"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18yXcUDS5lL03leRPLNqAfy"
Cancel-Lock: sha1:mi7Wx/+W926TC3iXdnxOsvq9Xjs=
View all headers

On Mon, 26 Aug 2024 08:33:30 -0700
John Ames <commodorejohn@gmail.com> wrote:
>On Thu, 22 Aug 2024 08:21:29 -0000 (UTC)
>Muttley@dastardlyhq.com wrote:
>> Yes, this is a royal PITA. I use tabs as in vim I can instantly
>> change the indentation using "set ts=". With spaces its fixed short
>> of dicking about with macros.
>
>All of this. Are there some safeguards in place for the most egregious
>cases? Yes - but literal whitespace is still a horrendous misfeature,
>something the world at large has known for so long that it was already
>an established joke by the time Ed Post was cracking wise about JCL in
>freakin' _Datamation._
>
>Python is far from the worst language out there - in fact, it's quite
>usable for a wide variety of applications, in spite of that - but the
>simple fact that Guido & co. made a boneheaded choice like that is the
>reason I'll never be able to *respect* it, even when I do find myself
>using it. There should - plain and simple - *never* be a time where you
>can end up with unexpected semantic behavior because of settings in
>your editor-of-choice.

Literal whitespace also has a knock on effect that I'm guessing Guido didn't
consider. It prevents python being used in command line shell pipes for
anything useful unlike perl and awk.

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: Mon, 26 Aug 2024 21:35 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: Mon, 26 Aug 2024 21:35:25 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 88
Message-ID: <vaises$2k7o6$2@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <uvbfii$3mom0$1@news.xmission.com>
<20240412094809.811@kylheku.com> <87il0mm94y.fsf@tudado.org>
<way-20240413091747@ram.dialup.fu-berlin.de> <87il0lldf8.fsf@tudado.org>
<choices-20240413123957@ram.dialup.fu-berlin.de>
<v9lm2k$12qhv$1@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>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 26 Aug 2024 23:35:25 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="eec8a5f8880ec9ebcfea2c2354da2438";
logging-data="2760454"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ZRbzyw2cXndbPNqq3tAyX"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:id8UsdPl0bUtBLEtPlWfr1OaUtk=
View all headers

On Mon, 26 Aug 2024 08:33:30 -0700, John Ames wrote:

> ... the simple fact that Guido & co. made a boneheaded choice like that
> is the reason I'll never be able to *respect* it, even when I do find
> myself using it.

I restore the redundancy by using “#end” comments. E.g. a seriously
nontrivial case:

def def_struct_class(name, ctname, extra = None) :
# defines a class with attributes that are a straightforward mapping
# of a ctypes struct. Optionally includes extra members from extra
# if specified.

ctstruct = getattr(CAIRO, ctname)

class result_class :

__slots__ = tuple(field[0] for field in ctstruct._fields_) # to forestall typos

def to_cairo(self) :
"returns a Cairo representation of the structure."
result = ctstruct()
for name, cttype in ctstruct._fields_ :
setattr(result, name, getattr(self, name))
#end for
return \
result
#end to_cairo

@classmethod
def from_cairo(celf, r) :
"decodes the Cairo representation of the structure."
result = celf()
for name, cttype in ctstruct._fields_ :
setattr(result, name, getattr(r, name))
#end for
return \
result
#end from_cairo

def __getitem__(self, i) :
"allows the object to be coerced to a tuple."
return \
getattr(self, ctstruct._fields_[i][0])
#end __getitem__

def __repr__(self) :
return \
(
"%s(%s)"
%
(
name,
", ".join
(
"%s = %s" % (field[0], getattr(self, field[0]))
for field in ctstruct._fields_
),
)
)
#end __repr__

#end result_class

#begin def_struct_class
result_class.__name__ = name
result_class.__doc__ = \
(
"representation of a Cairo %s structure. Fields are %s."
"\nCreate by decoding the Cairo form with the from_cairo method;"
" convert an instance to Cairo form with the to_cairo method."
%
(
ctname,
", ".join(f[0] for f in ctstruct._fields_),
)
)
if extra != None :
for attr in dir(extra) :
if not attr.startswith("__") :
setattr(result_class, attr, getattr(extra, attr))
#end if
#end for
#end if
return \
result_class
#end def_struct_class

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: Mon, 26 Aug 2024 22:51 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: 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: Mon, 26 Aug 2024 15:51:13 -0700
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <20240826155113.000005ba@gmail.com>
References: <uu54la$3su5b$6@dont-email.me>
<uvbfii$3mom0$1@news.xmission.com>
<20240412094809.811@kylheku.com>
<87il0mm94y.fsf@tudado.org>
<way-20240413091747@ram.dialup.fu-berlin.de>
<87il0lldf8.fsf@tudado.org>
<choices-20240413123957@ram.dialup.fu-berlin.de>
<v9lm2k$12qhv$1@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>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Injection-Date: Tue, 27 Aug 2024 00:51:19 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c62baac07f031517b799d089578b332c";
logging-data="2758469"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+H/8oeFb8+VaQTqdp4LCMHCQXodD6h4BY="
Cancel-Lock: sha1:cauSSAvo2IAojHFDJgqBJReY3Mk=
X-Newsreader: Claws Mail 4.2.0 (GTK 3.24.38; x86_64-w64-mingw32)
View all headers

On Mon, 26 Aug 2024 21:35:25 -0000 (UTC)
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:

> I restore the redundancy by using “#end” comments. E.g. a seriously
> nontrivial case:

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.

(Thing I'm curious about, but don't have a test environment to hand -
does a blank line with a different indent level, in between lines of
the same level, break out of the block? E.g., given the following:

if condition:
foo()

bar()

baz()

if one needs to re-arrange the order of operations, for reasons, and
one is incautious about selecting and shuffling lines in one's editor,
such that one ends up with this:

if condition:
bar()

foo()

baz()

....what happens? Does the interpreter catch this as an "obvious"
mistake? Does foo() get called regardless of condition? Depending on
$EDITOR/settings this is visually indistinguishable and not a difficult
position to end up in.)

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: Mon, 26 Aug 2024 22:51 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: bc@freeuk.com (Bart)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Mon, 26 Aug 2024 23:51:40 +0100
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <vaj0ts$2kusd$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <uvbfii$3mom0$1@news.xmission.com>
<20240412094809.811@kylheku.com> <87il0mm94y.fsf@tudado.org>
<way-20240413091747@ram.dialup.fu-berlin.de> <87il0lldf8.fsf@tudado.org>
<choices-20240413123957@ram.dialup.fu-berlin.de>
<v9lm2k$12qhv$1@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>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 27 Aug 2024 00:51:40 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0eb40e535de99d049ec5580a004404e4";
logging-data="2784141"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+aDmw4Mej+/w3sO92CbV7H"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:4mCDFiBBq8gUZQ4EwXSGThsTFIE=
In-Reply-To: <vaises$2k7o6$2@dont-email.me>
Content-Language: en-GB
View all headers

On 26/08/2024 22:35, Lawrence D'Oliveiro wrote:
> On Mon, 26 Aug 2024 08:33:30 -0700, John Ames wrote:
>
>> ... the simple fact that Guido & co. made a boneheaded choice like that
>> is the reason I'll never be able to *respect* it, even when I do find
>> myself using it.
>
> I restore the redundancy by using “#end” comments. E.g. a seriously
> nontrivial case:

This might the human reader but the redundancy really needs to be
supported by the language.

Here, that s2 line has been knocked out of place; the indent is missing.
But the language can't detect it, even with #end; it makes s2 unconditional:

if c:
s1
s2
#end

With language support:

if c:
s1
s2
end

Here the redundancy means the compiler knows both s1 and s2 are in the
same conditional block, and it can choose to report an indentation
inconsistency.

Subject: Re: Python (was Re: I did not inhale)
From: Kaz Kylheku
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Mon, 26 Aug 2024 23:32 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: 643-408-1753@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Mon, 26 Aug 2024 23:32:56 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <20240826163222.577@kylheku.com>
References: <uu54la$3su5b$6@dont-email.me>
<uvbfii$3mom0$1@news.xmission.com> <20240412094809.811@kylheku.com>
<87il0mm94y.fsf@tudado.org> <way-20240413091747@ram.dialup.fu-berlin.de>
<87il0lldf8.fsf@tudado.org>
<choices-20240413123957@ram.dialup.fu-berlin.de>
<v9lm2k$12qhv$1@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>
Injection-Date: Tue, 27 Aug 2024 01:32:56 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c2314ea8685c1e03de09ccc558adcf70";
logging-data="2796257"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Gq5teRDr+Y+jOdu/m+fOf2HG5fI2v7Kk="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:FaVsOa3EW37S5CclFs23xeJeitY=
View all headers

On 2024-08-26, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
> I restore the redundancy by ...

just standing here?

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

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 02: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 28
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 02:49:19 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <vajerf$2qjbn$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <uvbfii$3mom0$1@news.xmission.com>
<20240412094809.811@kylheku.com> <87il0mm94y.fsf@tudado.org>
<way-20240413091747@ram.dialup.fu-berlin.de> <87il0lldf8.fsf@tudado.org>
<choices-20240413123957@ram.dialup.fu-berlin.de>
<v9lm2k$12qhv$1@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>
<vaj0ts$2kusd$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 04:49:20 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="546aa385814575b64d15f1d40accd158";
logging-data="2968951"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18G3LWVODU12eW46zmvdWVT"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:3eOSjMr/ShcNzbrSfeTDXHd4pEk=
View all headers

On Mon, 26 Aug 2024 23:51:40 +0100, Bart wrote:

> This might [...] the human reader but the redundancy really needs to be
> supported by the language.

Consider what I mean by “redundancy”: it means the structure of the code
is expressed two different ways.

In a conventional language with statement bracketing symbols, the compiler
ignores the indentation, but you use that to delineate the same structure
as defined by the actual language symbols, thereby providing redundancy to
the human reader.

In Python, the compiler goes by the indentation, so I add standins for
statement bracketing symbols in the form of “#end” comments: these are
ignored by the compiler, but I use that as an alternative, redundant way
of delineating the same program structure to the human reader.

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 02:50 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 28
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 02:50:41 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <vajeu0$2qks2$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <uvbfii$3mom0$1@news.xmission.com>
<20240412094809.811@kylheku.com> <87il0mm94y.fsf@tudado.org>
<way-20240413091747@ram.dialup.fu-berlin.de> <87il0lldf8.fsf@tudado.org>
<choices-20240413123957@ram.dialup.fu-berlin.de>
<v9lm2k$12qhv$1@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>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 27 Aug 2024 04:50:41 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0a410b51be7b0d25514a712e66466478";
logging-data="2970498"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Bu+0Mz2988wXHflp+LhVe"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:bb41po5h5pxxuilj5QKM57ztdes=
View all headers

On Mon, 26 Aug 2024 15:51:13 -0700, John Ames wrote:

> if condition:
> foo()
>
> bar()
>
> baz()
>
> if one needs to re-arrange the order of operations, for reasons, and one
> is incautious about selecting and shuffling lines in one's editor, such
> that one ends up with this:
>
> if condition:
> bar()
>
> foo()
>
> baz()

Try:

if condition:
foo()
bar()
#end if
baz()

versus

if condition:
bar()
foo()
#end if
baz()

Does that make things clearer?

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: Tue, 27 Aug 2024 03:21 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: Tue, 27 Aug 2024 03:21:28 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <vajgnm$2qoj2$2@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>
Injection-Date: Tue, 27 Aug 2024 05:21:28 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c272b04af259c394792dde53c800b5b3";
logging-data="2974306"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19H49AoQMiuJEU/c9Se6KT9ZZNZU1Zb/5s="
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.1.0-18-amd64 (x86_64))
Cancel-Lock: sha1:yxAuMsK7+c4qfu2hXgkMdZ+RPDo=
View all headers

In comp.unix.programmer John Ames <commodorejohn@gmail.com> wrote:
> On Mon, 26 Aug 2024 21:35:25 -0000 (UTC)
> Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>
>> I restore the redundancy by using ?#end? comments. E.g. a seriously
>> nontrivial case:
>
> 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.
>
> (Thing I'm curious about, but don't have a test environment to hand -
> does a blank line with a different indent level, in between lines of
> the same level, break out of the block? E.g., given the following:
>
> if condition:
> foo()
>
> bar()
>
> baz()

The answer is that it doesn't matter if the blank line between foo() and
bar() contains four spaces. bar() will always be treated as being part
of the if statement's body.

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: Tue, 27 Aug 2024 08:39 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!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: Tue, 27 Aug 2024 09:39:29 +0100
Organization: terraraq NNTP server
Message-ID: <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
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>
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="29633"; mail-complaints-to="usenet@innmantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:uywtbncMVo5wPBx293j8/GLCDZU=
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:
> 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.

As an aesthetic objection, of course, there’s no accounting for
taste. But it doesn’t seem to be a practical problem in reality.

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

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

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: Tue, 27 Aug 2024 10:26 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: Tue, 27 Aug 2024 11:26:18 +0100
Organization: A noiseless patient Spider
Lines: 80
Message-ID: <vak9k9$2ujrs$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>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 27 Aug 2024 12:26:18 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0eb40e535de99d049ec5580a004404e4";
logging-data="3100540"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19e6ibPXtf15fYnLde6Z3aW"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:t4KK95iKFwxavJiRoexToSo48p8=
In-Reply-To: <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
Content-Language: en-GB
View all headers

On 27/08/2024 09:39, Richard Kettlewell 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.
>
> As an aesthetic objection, of course, there’s no accounting for
> taste. But it doesn’t seem to be a practical problem in reality.
>
> (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.)

These are the problems I've seen. I haven't used the language
extensively, but I've used it enough.

(1) An tab at the start of a line gets accidentally indented or
unindented. If you weren't paying close attention, it may not be clear
that that has happened, if this line was either the last line of an
indented block, or the line following

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

(3) Similarly, you want to temportarily wrap an 'if' statement, for
example, around a block of code. But you can't do it witout indenting
that block.

(4) Sometimes you want to add temporary debug code as part of a block.
Usually I write such lines in all-caps and without indentation to make
them stand out clear. With Python, I can't use all-caps and I have to
use exactly the same indent as the rest of the block. So the lines
merge. Then when I need to remove the code, it's not clearly delimited.

(5) Sometimes you want to temporarily comment out the contents of a
block. But Python doesn't allow an empty block; now you have to use
'pass'. And then get rid of if later.

(6) You want to add extra statements to the end of a block, but where IS
the end? You have to INFER the ending by looking for a line with a
smaller indent. But suppose you're at the bottom of a window; is that
bottom line the last in the block, or is there another one at the same
indent just out of sight? You have to tentatively keep peeking ahead!

(6a) And maybe there's big comment blocking in the middle of block;
comments don't need nesting! If there are lots of comments and few
statements, finding the end of the block (ie. the last statement of this
block) can become quite an exercise.

(7) You take some Python code you've seen online (eg. in a usenet post)
and paste into your editor. Maybe you want to merge it with your own code.

But its tabbing is all spaces; yours is all tabs. Plus invariably, the
whole thing has extra indentation (eg. the leftmost statement is already
indented). Or you want to copy code from within a block to a different
indent level.

The whole thing gets very messy and error prone. You need special editor
commands to deal with the mess.

Indented, non-delimited code and data is fine for machine-generated and
machine processed code. But it's a disaster for code that has to be
human-generated and human-maintained. It's just too fragile.

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.

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: Tue, 27 Aug 2024 12:46 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!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: Tue, 27 Aug 2024 13:46:36 +0100
Organization: terraraq NNTP server
Message-ID: <wwva5gykuab.fsf@LkoBDZeT.terraraq.uk>
References: <uu54la$3su5b$6@dont-email.me> <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>
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="32831"; mail-complaints-to="usenet@innmantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:1Xqdwo+YBgobXo7EgTpM3SOUqKQ=
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

Bart <bc@freeuk.com> writes:
> On 27/08/2024 09:39, Richard Kettlewell 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.
>> As an aesthetic objection, of course, there’s no accounting for
>> taste. But it doesn’t seem to be a practical problem in reality.
>> (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.)
>
> These are the problems I've seen. I haven't used the language
> extensively, but I've used it enough.

All I can say is that for the most part these issues just don’t arise
for me. Some are plainly aesthetic; I already addressed that. Others
sounds like issues with your tooling - changing the indentation of a
range of lines is easy in most editors, for example.

The cases that actually seem familiar:

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

You can put ‘or True’ at the end of the condition.

> (5) Sometimes you want to temporarily comment out the contents of a
> block. But Python doesn't allow an empty block; now you have to use
> 'pass'. And then get rid of if later.

You can put an ‘if False’ at the top.

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

--
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: Tue, 27 Aug 2024 13:10 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
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: Tue, 27 Aug 2024 15:10:08 +0200
Organization: A noiseless patient Spider
Lines: 152
Message-ID: <vakj7g$303sh$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>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 27 Aug 2024 15:10:09 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="3ebac65f8a7020bc598e9f93c91355b6";
logging-data="3149713"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18OIbBzeid7k4AGlkEyd7FE4Vu6ho2vxhY="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:FK9wYDBtj96guAyCcSY8/qUEnaY=
In-Reply-To: <vak9k9$2ujrs$1@dont-email.me>
Content-Language: en-GB
View all headers

On 27/08/2024 12:26, Bart wrote:
> On 27/08/2024 09:39, Richard Kettlewell 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 have occasionally, but only occasionally, seen problems with white
space. And those would normally be caught by Python 3.

>> As an aesthetic objection, of course, there’s no accounting for
>> taste. But it doesn’t seem to be a practical problem in reality.
>>
>> (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.)
>
> These are the problems I've seen. I haven't used the language
> extensively, but I've used it enough.

Your problems below are all valid, but not insurmountable. I too would
rather have explicit block delimiters, but it's not actually hard to
work with Python as it is.

>
> (1) An tab at the start of a line gets accidentally indented or
> unindented. If you weren't paying close attention, it may not be clear
> that that has happened, if this line was either the last line of an
> indented block, or the line following
>

That /can/ happen. It is a good idea to avoid mixing tabs and spaces in
the same file. Most editors can be configured one way or the other, but
if you use different editors under different circumstances (as I do),
mistakes are possible. They are usually quickly identified and quickly
handled.

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

Replace your

if cond :

with

if 1 :

or

if True :

>
> (3) Similarly, you want to temportarily wrap an 'if' statement, for
> example, around a block of code. But you can't do it witout indenting
> that block.
>

True. But any editor will let you select the lines and indent them.

> (4) Sometimes you want to add temporary debug code as part of a block.
> Usually I write such lines in all-caps and without indentation to make
> them stand out clear. With Python, I can't use all-caps and I have to
> use exactly the same indent as the rest of the block. So the lines
> merge. Then when I need to remove the code, it's not clearly delimited.

Comments are an extremely easy way to make the code stand out.

>
> (5) Sometimes you want to temporarily comment out the contents of a
> block. But Python doesn't allow an empty block; now you have to use
> 'pass'. And then get rid of if later.

You can leave the "pass" in, if you don't want to get ride of it later.
I sometimes find "pass" to be helpful as an alternative to leaving a
hanging indented block.

>
> (6) You want to add extra statements to the end of a block, but where IS
> the end? You have to INFER the ending by looking for a line with a
> smaller indent. But suppose you're at the bottom of a window; is that
> bottom line the last in the block, or is there another one at the same
> indent just out of sight? You have to tentatively keep peeking ahead!

Keep your blocks small and neat.

>
> (6a) And maybe there's big comment blocking in the middle of block;
> comments don't need nesting! If there are lots of comments and few
> statements, finding the end of the block (ie. the last statement of this
> block) can become quite an exercise.

That applies to every programming language (unless you know of one that
doesn't support comments).

>
> (7) You take some Python code you've seen online (eg. in a usenet post)
> and paste into your editor. Maybe you want to merge it with your own code.
>
> But its tabbing is all spaces; yours is all tabs. Plus invariably, the
> whole thing has extra indentation (eg. the leftmost statement is already
> indented). Or you want to copy code from within a block to a different
> indent level.

Any sane editor will give you tools to fix that - automatic indentation,
tab-to-space and space-to-tab conversion, manual indent or outdent block
tools, etc.

>
> The whole thing gets very messy and error prone. You need special editor
> commands to deal with the mess.

No, you don't. (Unless you think "special" means "anything but Windows
Notepad" .)

>
> Indented, non-delimited code and data is fine for machine-generated and
> machine processed code. But it's a disaster for code that has to be
> human-generated and human-maintained. It's just too fragile.
>

In real-life Python coding, it works fine. I prefer explicit block
delimiters, but I cannot say Python's white-space blocking has been a
significant source of trouble or inconvenience for me. Perhaps that's
because I have always been used to careful and consistent formatting. I
don't write C code (or any other code) with inconsistent spacing, mixes
of tabs and spaces, or unexpected indentations. So for me, the spacing
and tabbing of Python code would be identical if it had braces or other
begin-end markers.

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

No one has to do that. It's a Lawrence peculiarity, and his coding
style (in Python or C, and probably anything else) would be rejected by
anyone with a coding standard. I agree that it suggests that something
is badly wrong, but it is not with the language!

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: Tue, 27 Aug 2024 14:18 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: bc@freeuk.com (Bart)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Tue, 27 Aug 2024 15:18:47 +0100
Organization: A noiseless patient Spider
Lines: 238
Message-ID: <vakn87$30oaf$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> <vakj7g$303sh$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 27 Aug 2024 16:18:48 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0eb40e535de99d049ec5580a004404e4";
logging-data="3170639"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18UwT1J4qkjq+f8gtBfHRwx"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:vMlBttEj13I4Kk8XCFdfJdoeIcU=
Content-Language: en-GB
In-Reply-To: <vakj7g$303sh$1@dont-email.me>
View all headers

On 27/08/2024 14:10, David Brown wrote:
> On 27/08/2024 12:26, Bart wrote:
>> On 27/08/2024 09:39, Richard Kettlewell 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 have occasionally, but only occasionally, seen problems with white
> space.  And those would normally be caught by Python 3.
>
>>> As an aesthetic objection, of course, there’s no accounting for
>>> taste. But it doesn’t seem to be a practical problem in reality.
>>>
>>> (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.)
>>
>> These are the problems I've seen. I haven't used the language
>> extensively, but I've used it enough.
>
> Your problems below are all valid, but not insurmountable.  I too would
> rather have explicit block delimiters, but it's not actually hard to
> work with Python as it is.
>
>>
>> (1) An tab at the start of a line gets accidentally indented or
>> unindented. If you weren't paying close attention, it may not be clear
>> that that has happened, if this line was either the last line of an
>> indented block, or the line following
>>
>
> That /can/ happen.  It is a good idea to avoid mixing tabs and spaces in
> the same file.  Most editors can be configured one way or the other, but
> if you use different editors under different circumstances (as I do),
> mistakes are possible.  They are usually quickly identified and quickly
> handled.
>
>> (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. 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...
>
> Replace your
>
>     if cond :
>
> with
>
>     if 1 :
>
> or
>
>     if True :
>
>
>>
>> (3) Similarly, you want to temportarily wrap an 'if' statement, for
>> example, around a block of code. But you can't do it witout indenting
>> that block.
>>
>
> True.  But any editor will let you select the lines and indent them.
>
>> (4) Sometimes you want to add temporary debug code as part of a block.
>> Usually I write such lines in all-caps and without indentation to make
>> them stand out clear. With Python, I can't use all-caps and I have to
>> use exactly the same indent as the rest of the block. So the lines
>> merge. Then when I need to remove the code, it's not clearly delimited.
>
> Comments are an extremely easy way to make the code stand out.
>
>>
>> (5) Sometimes you want to temporarily comment out the contents of a
>> block. But Python doesn't allow an empty block; now you have to use
>> 'pass'. And then get rid of if later.
>
> You can leave the "pass" in, if you don't want to get ride of it later.
> I sometimes find "pass" to be helpful as an alternative to leaving a
> hanging indented block.
>
>>
>> (6) You want to add extra statements to the end of a block, but where
>> IS the end? You have to INFER the ending by looking for a line with a
>> smaller indent. But suppose you're at the bottom of a window; is that
>> bottom line the last in the block, or is there another one at the same
>> indent just out of sight? You have to tentatively keep peeking ahead!
>
> Keep your blocks small and neat.
>
>>
>> (6a) And maybe there's big comment blocking in the middle of block;
>> comments don't need nesting! If there are lots of comments and few
>> statements, finding the end of the block (ie. the last statement of
>> this block) can become quite an exercise.
>
> That applies to every programming language (unless you know of one that
> doesn't support comments).
>
>>
>> (7) You take some Python code you've seen online (eg. in a usenet
>> post) and paste into your editor. Maybe you want to merge it with your
>> own code.
>>
>> But its tabbing is all spaces; yours is all tabs. Plus invariably, the
>> whole thing has extra indentation (eg. the leftmost statement is
>> already indented). Or you want to copy code from within a block to a
>> different indent level.
>
> Any sane editor will give you tools to fix that - automatic indentation,
> tab-to-space and space-to-tab conversion, manual indent or outdent block
> tools, etc.
>
>>
>> The whole thing gets very messy and error prone. You need special
>> editor commands to deal with the mess.
>
> No, you don't.  (Unless you think "special" means "anything but Windows
> Notepad" .)
>
>>
>> Indented, non-delimited code and data is fine for machine-generated
>> and machine processed code. But it's a disaster for code that has to
>> be human-generated and human-maintained. It's just too fragile.
>>
>
> In real-life Python coding, it works fine.  I prefer explicit block
> delimiters, but I cannot say Python's white-space blocking has been a
> significant source of trouble or inconvenience for me.  Perhaps that's
> because I have always been used to careful and consistent formatting.  I
> don't write C code (or any other code) with inconsistent spacing, mixes
> of tabs and spaces, or unexpected indentations.  So for me, the spacing
> and tabbing of Python code would be identical if it had braces or other
> begin-end markers.
>
>> 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.
>>
>
> No one has to do that.  It's a Lawrence peculiarity, and his coding
> style (in Python or C, and probably anything else) would be rejected by
> anyone with a coding standard.  I agree that it suggests that something
> is badly wrong, but it is not with the language!

It's not just him. Below is some Nim code, which uses indentation like
Python. (It's from inside other statements which accounts for the
overall indents.)

Suppose I want to add code to follow that top-level 'if' statement;
where would it go? Since it's not clear from my extract whether that's
the entire content of my if statement.

And at what indent level, since I'm some way off from that if? It's easy
to get it wrong.

if q1!=1:
for i in countup(2,n):
q[i]=p[i]
flips=1
while true:
qq=q[q1]
if qq==1:
sum+=sign*flips
if flips>maxflips:
maxflips=flips
break
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
q1=qq
flips+=1

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


Click here to read the complete article
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: Tue, 27 Aug 2024 15:03 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: 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: Tue, 27 Aug 2024 08:03:20 -0700
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <20240827080320.00003fd2@gmail.com>
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>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 27 Aug 2024 17:03:25 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c62baac07f031517b799d089578b332c";
logging-data="3145794"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+cwWgWplHbBTH0bz4cuodMrGL7IOHLfhI="
Cancel-Lock: sha1:9MbsPtREN8linYu454/YQeU7hC0=
X-Newsreader: Claws Mail 4.2.0 (GTK 3.24.38; x86_64-w64-mingw32)
View all headers

On Tue, 27 Aug 2024 15:10:08 +0200
David Brown <david.brown@hesbynett.no> wrote:

> > (6) You want to add extra statements to the end of a block, but
> > where IS the end? You have to INFER the ending by looking for a
> > line with a smaller indent. But suppose you're at the bottom of a
> > window; is that bottom line the last in the block, or is there
> > another one at the same indent just out of sight? You have to
> > tentatively keep peeking ahead!
>
> Keep your blocks small and neat.

That's very much one for the "good advice that is not always feasible
in the Real World" file. Every project has its own natural balance of
"large things that can be easily re-factored into sets of small things"
(i.e. things you can function-ize) vs. "large things that cannot."

> > (6a) And maybe there's big comment blocking in the middle of block;
> > comments don't need nesting! If there are lots of comments and few
> > statements, finding the end of the block (ie. the last statement of
> > this block) can become quite an exercise.
>
> That applies to every programming language (unless you know of one
> that doesn't support comments).

It applies very much moreso to languages where comments *must* follow
the indentation level of the surrounding code, so that the deeper you
go, the more lines you have to split comments across.

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: Tue, 27 Aug 2024 18:08 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: Muttley@dastardlyhq.com
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Tue, 27 Aug 2024 18:08:22 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <val4mm$334k2$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>
<vakj7g$303sh$1@dont-email.me>
<20240827080320.00003fd2@gmail.com>
Content-Type: text/plain; charset=US-ASCII
Injection-Date: Tue, 27 Aug 2024 20:08:22 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="6d2e8dd19f5b27b1c7d4294f1e693bc3";
logging-data="3248770"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/wHY7JEM8M/B+eEYm/qfQf"
Cancel-Lock: sha1:TK2L/E4bX8sydJCcgjeVpnlGh7c=
View all headers

On Tue, 27 Aug 2024 08:03:20 -0700
John Ames <commodorejohn@gmail.com> wrote:
>It applies very much moreso to languages where comments *must* follow
>the indentation level of the surrounding code, so that the deeper you
>go, the more lines you have to split comments across.

Unless you're one of those developers for whom breaking up lines is a foreign
concept and you just continue on a single line until you're done no matter
how long it is.

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: Tue, 27 Aug 2024 18:46 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: Tue, 27 Aug 2024 20:46:27 +0200
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <val6u3$33e82$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> <vakj7g$303sh$1@dont-email.me>
<20240827080320.00003fd2@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 27 Aug 2024 20:46:27 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="8355d15901bc9a80f13d9e1f7352f9f2";
logging-data="3258626"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+EAX83JW+oMWuDEsUYjwXoNpvn490h8m0="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:4izAsHW0hAnsJmUfFMTJEg7XPAo=
In-Reply-To: <20240827080320.00003fd2@gmail.com>
Content-Language: en-GB
View all headers

On 27/08/2024 17:03, John Ames wrote:
> On Tue, 27 Aug 2024 15:10:08 +0200
> David Brown <david.brown@hesbynett.no> wrote:
>
>>> (6) You want to add extra statements to the end of a block, but
>>> where IS the end? You have to INFER the ending by looking for a
>>> line with a smaller indent. But suppose you're at the bottom of a
>>> window; is that bottom line the last in the block, or is there
>>> another one at the same indent just out of sight? You have to
>>> tentatively keep peeking ahead!
>>
>> Keep your blocks small and neat.
>
> That's very much one for the "good advice that is not always feasible
> in the Real World" file. Every project has its own natural balance of
> "large things that can be easily re-factored into sets of small things"
> (i.e. things you can function-ize) vs. "large things that cannot."
>

Sure. But if you keep such advice at hand, then it is often easier to
make it feasible. Occasionally code is best formatted with a big
function or two, but most of the time it is possible and preferable to
have relatively small function.

>>> (6a) And maybe there's big comment blocking in the middle of block;
>>> comments don't need nesting! If there are lots of comments and few
>>> statements, finding the end of the block (ie. the last statement of
>>> this block) can become quite an exercise.
>>
>> That applies to every programming language (unless you know of one
>> that doesn't support comments).
>
> It applies very much moreso to languages where comments *must* follow
> the indentation level of the surrounding code, so that the deeper you
> go, the more lines you have to split comments across.
>

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

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:34 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
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:34:54 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <valgpu$34s18$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>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 27 Aug 2024 23:34:55 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="2836e4fdb00ca78ddad73240b3d2d9a3";
logging-data="3305512"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18c1vMvqET1cCjwQ3N3uSNd"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:ubOXZ62sJplFoGHgfhRQJIOX8Y0=
View all headers

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.

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

> (6a) And maybe there's big comment blocking in the middle of block;
> comments don't need nesting! If there are lots of comments and few
> statements, finding the end of the block (ie. the last statement of this
> block) can become quite an exercise.

Again, “#end” comments help with this.

> (7) You take some Python code you've seen online (eg. in a usenet post)
> and paste into your editor. Maybe you want to merge it with your own
> code.
>
> But its tabbing is all spaces; yours is all tabs. Plus invariably, the
> whole thing has extra indentation (eg. the leftmost statement is already
> indented). Or you want to copy code from within a block to a different
> indent level.

Like I said, Emacs makes this easy. Also a quick application of “untabify”
will turn all tabs in the selected region to spaces, to match with the
rest of my code.

Pages:12345678910

rocksolid light 0.9.8
clearnet tor