Sujet : Re: Python (was Re: I did not inhale)
De : invalid (at) *nospam* invalid.invalid (Richard Kettlewell)
Groupes : comp.unix.shell comp.unix.programmer comp.lang.miscDate : 28. Aug 2024, 16:41:36
Autres entêtes
Organisation : terraraq NNTP server
Message-ID : <wwvzfowlknj.fsf@LkoBDZeT.terraraq.uk>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
John Ames <
commodorejohn@gmail.com> writes:
Sebastian <sebastian@here.com.invalid> wrote:
>
At my company, somebody tried to delete a method like method2()
above, but forgot the last few lines (represented by call6()). This
does not introduce a SyntaxError. Instead, call6() is now part of
method1() because it's at the same level of indentation. In most
programming languages, the beginning of method2() would be preceded
by some delimiter marking the end of method1(), which would prevent
an accidental merger of this type.
>
(Waiting for the Python advocates to fire back with "well, don't do
that, then!" and completely miss the point that it's exactly the topic
of contention here that Python's scope-by-layout approach that makes it
easy to do that...)
Earlier I wrote:
| (In contrast C’s rules have occasionally been a practical problem,
| contributing to at least one high-profile software vulnerability and
| attracting compiler warnings to mitigate the risks.)
The situation seems pretty similar. In any language if you delete the
wrong thing then you probably won’t like the outcome. In both cases if
it’s not quickly detected by unit tests or some other automation then
it’s probably time to review your approach to quality.
-- https://www.greenend.org.uk/rjk/