[Python-ideas] Syntax: 'return: ...' expressions

Nick Coghlan ncoghlan at gmail.com
Fri Jan 9 08:35:37 CET 2015


On 8 January 2015 at 11:05, Yawar Amin <yawar.amin at gmail.com> wrote:
> As promised, a write-up of my idea:
> http://yawar.blogspot.ca/2015/01/expressive-functional-programming-with.html

The statement/expression distinction is deliberate, for the reasons
you describe in the final article of your post. You will have zero
chance of persuading anyone if you start from an assumption that the
distinction is accidental.

That said, there are some *very* limited situations where pulling
things out-of-line in order to name them reduces readability (see PEPs
403 and 3150 for further discussion of that), and other situations
where semantically significant leading whitespace causes practical
problems (see http://python-notes.curiousefficiency.org/en/latest/pep_ideas/suite_expr.html
for the discussion of that).

If you can come up with a practical proposal that better handles those
situations, *without* having a generally negative effect on code
readability, and without introducing "two ways to do it" for various
problems that will complicate learning, then you may have something
signficant.

But for something as fundamental as introducing new syntax, you need
to start with concrete use cases, rather than hypothetical "it might
be useful if..." situations.

Regards,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-ideas mailing list