On 17/06/2020 10:42, artem6191 wrote:
So yeah, we can "if <expression>: return", but why not?
Because without a decent reason otherwise, status quo ante wins.
When I was writing a lot of Perl, I used the "<stmt> if <cond>;" form
quite a lot to start with. Partly that was the novelty of it, part was
that it reads naturally in English, and part was that I was used to
writing ARM assembler (and I do mean ARM, not Thumb) so applying
condition codes to every line was a natural if misdirected thing to me.
Once the novelty wore off, I found I only used that form when the
statement needed serious thought (usually because of a regex) and the
condition was an afterthought. For anything I actually cared about, I
wanted the visible structuring with line breaks and all.
--
Rhodri James *-* Kynesim Ltd
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/python-ideas@python.org/message/C3ZE4P6X2YF5UPD7WTEF4Q3MZQZDFLKH/
Code of Conduct: http://python.org/psf/codeofconduct/