On Wed, 17 Jun 2020 at 10:44, artem6191 <artem129...@gmail.com> wrote: > > So yeah, we can "if <expression>: return", but why not?
That's the wrong question. The correct question is "why is this needed, and is the need sufficiently pressing to justify the change to the language?" You're talking about allowing "return EXPR if CONDITION" as an exact equivalent of "if CONDITION: return EXPR". There isn't even a benefit of "it saves a line of code", so it's very hard to see a justification. Paul _______________________________________________ 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/PHB2VWU3J2YAGCWZR5N5N2BAGPFBQMF4/ Code of Conduct: http://python.org/psf/codeofconduct/