On Fri, 17 Feb 2017 at 10:23 Stephan Houben <stephan...@gmail.com> wrote:

> Proposal: Light-weight call-by-name syntax in Python
>
>   The following syntax
>      a : b
>   is to be interpreted as:
>      a(lambda: b)
>
> Effectively, this gives a "light-weight macro system" to Python,
> since it allows with little syntax to indicate that the argument to
> a function is not to be immediately invoked.
>

This is, in my view, one case where Python's existing lambda syntax is
perfectly sufficient. (I'd even argue it might be the *only* case...) If
you could logger.debug(lambda: expensive_to_compute_message_here), I don't
think that the delayed-expression proposal would ever have existed.

Ed
_______________________________________________
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