Hello, Multi-line lambda is element of many languages, but they are not needed in the form in which they are made in many languages. А good use would be to use the lambda as the last argument of the function. Syntax:
> def func(lambda1): > lambda1() > > func(): > print(1) > Can be used for create dsl. For example html: > html: > head() > > body(): > p(): > "Hello world" > a(href="python.org"): > "Python link" > Or for create new syntax constructions: > def unless(condition, _lambda): > if not(condition): > _lambda() > > unless(0): > print('yes') >
_______________________________________________ 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/2I5VT54SQN6BHGDDFYILX7AWJ4YT77RH/ Code of Conduct: http://python.org/psf/codeofconduct/