for -- else: what was the motivation?

Grant Edwards grant.b.edwards at gmail.com
Mon Oct 10 09:13:44 EDT 2022


On 2022-10-10, Chris Angelico <rosuav at gmail.com> wrote:
> On Mon, 10 Oct 2022 at 11:52, MRAB <python at mrabarnett.plus.com> wrote:
>>
>> On 2022-10-10 00:40, dn wrote:
>> > On Sun, 9 Oct 2022 at 15:39, Axy via Python-list
>> > <python-list at python.org> wrote:
>> >
>> >> "shortest block first"
>> >
>> > Have never heard this advice before. Kind-of rankled with me, as it did
>> > for others.

I've followed that advice for several decades. I find it much easier
to read code that's organized that way -- particularly when the
difference in block sizes is large (e.g. the first block is one line,
and the second is a a hundred).

--
Grant



More information about the Python-list mailing list