Hi Erik,

I have changed my proposal to the alternative syntax
 a:: b
(Note my preferred spacing.
This is to make it read like some annoation applied to the expression,
like
   delayed:: expensive_function()+1
)

Since :: is a binary operator, we need to think about
associativity.

My conservative proposal would be to make it non-associative,
you would have to write explicitly
  a:: (b:: c)
or
 (a:: b):: c

Stephan

Op 17 feb. 2017 22:35 schreef "Erik" <pyt...@lucidity.plus.com>:

On 17/02/17 10:22, Stephan Houben wrote:

> Proposal: Light-weight call-by-name syntax in Python
>
>   The following syntax
>      a : b
>   is to be interpreted as:
>      a(lambda: b)
>

Isn't this too general a syntax? Doesn't it lead to something like:

if a: b: c: d: e: pass

E.
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to