[Python-ideas] YAML (yet-another-multiline-lambda)
Philipp A.
flying-sheep at web.de
Tue Oct 22 15:33:38 CEST 2013
2013/10/22 Steven D’Aprano <steve at pearwood.info>
which would then make lambda redundant.
no, lambda still doesn’t need a return statement, returning the result of
its only expression.
so we could do
x = (def (a): a)assert x('b') == None
and
x = lambda a: aassert x('b') == 'b'
and about your “misleading constructions”: the ability to put arguments of
function definitions on their own lines is already ugly.
we basically have no switch statement because it would be indented twice or
half, but we indent twice or half when defining functions all the time. and
if your default argument is a function, you’ll definitely want it to be a
simple one anyway or would use the tried
def a(f=None):
if default is None:
def f():
...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20131022/cbef2415/attachment-0001.html>
More information about the Python-ideas
mailing list