On Fri, Feb 12, 2021 at 1:00 AM Brendan Barnwell <brenb...@brenbarn.net> wrote:
> > The only thing that would be better than lambda is a less > confusing > keyword. Is this really what this is all about? removing that word? I do think that adding a parens around the parameters would make it a bit more clear, but it currently illegal: In [18]: lambda(x, y): x + y File "<ipython-input-18-0f5b071bce98>", line 1 lambda(x, y): x + y ^ SyntaxError: invalid syntax > So like "func x: x+2" would be better than "lambda x: x+2". > That probably won't happen because no one wants to add new keywords. > There seems to be a frequent objection to the word "lambda" -- personally, I found it cryptic, but it's not hard to remember, and it IS easy to look up. But if you don't like that word, why not "def"? Every place I've tried to use "def" where "lambda" is legal, it's a syntax error. So we could use the same word. Would that be less confusing? My thought is yes it would , IF we were stating from scratch -- but this would be a lot of churn in code and documentation for very little gain. -Chris B > But adding new non-keyword ways to do this isn't worth it just to save a > few keystrokes. > > -- > Brendan Barnwell > "Do not follow where the path may lead. Go, instead, where there is no > path, and leave a trail." > --author unknown > _______________________________________________ > 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/ZGJ5WAI7YKMPSXWXOKNADRCP44SFR262/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython
_______________________________________________ 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/ZOLJESYPYEUAUDTP4I6NCF2PJ7STCOYV/ Code of Conduct: http://python.org/psf/codeofconduct/