Sujet : Re: Python (was Re: I did not inhale)
De : commodorejohn (at) *nospam* gmail.com (John Ames)
Groupes : comp.unix.shell comp.unix.programmer comp.lang.miscDate : 26. Aug 2024, 23:51:13
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240826155113.000005ba@gmail.com>
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 : Claws Mail 4.2.0 (GTK 3.24.38; x86_64-w64-mingw32)
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.)