On Wed, 17 Feb 2021 at 18:15, Abdulla Al Kathiri < alkathiri.abdu...@gmail.com> wrote:
> How is this not pythonic? > > series.apply(x -> x**2) > Compared to.. > series.apply(lambda x: x**2) > > > (x, y) -> x+y, () -> 0, (x) -> x**2 (for single parameter, we can write it > without parenthesis like the example above) are pythonic enough to my eyes. > Well, for m eyes, the above is definetellly "perlonic" . it could be "j" before being Pyrhon. This is Pythonic: def f1(x, y): return x + y def f2(): return 0 def f3(x): return x ** 2 And it took me a while looking at our example to check it was not really fuction composition with default parameters, or what. I mentioned violation of 6 of the first 7 phrases in the famous "zen of Python" - most important of which can be reasonably agreed is the 7th: "Readability counts". If you don't want readability at all in exchange for typing a few keywords (which more and more automatic tools can auto-complete), I'd suggest going for the "forth" language. Abdulla > > On 17 Feb 2021, at 10:59 PM, Joao S. O. Bueno <jsbu...@python.org.br> > wrote: > > If someone comes with a "pythonic" way to lift restrictions on > lambda, that could be something for debate, but so far this is > just about uglifying it, and creating a new syntax matching > exactly what exists today. > > >
_______________________________________________ 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/GL4TPNMIDZTH63WO6E6QNZX57NGYZH2L/ Code of Conduct: http://python.org/psf/codeofconduct/