On Sun, 9 Oct 2022 at 15:39, Axy via Python-list <python-list@python.org> wrote:
>
> Got it, thanks!
>
> Actually the reason I never used "else" was the violation of the rule of
> beauty "shortest block first". With if--else you can easily follow this
> rule by inverting "if" expression, but with for--else you can't. The
> loop body of the simplest example is already three lines, in real life
> things are much worse.
>

That's not a rule I've ever been taught; how important is it?

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to