Sujet : Re: Python (was Re: I did not inhale)
De : bc (at) *nospam* freeuk.com (Bart)
Groupes : comp.unix.shell comp.unix.programmer comp.lang.miscDate : 26. Aug 2024, 23:51:40
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vaj0ts$2kusd$1@dont-email.me>
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
User-Agent : Mozilla Thunderbird
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.