[Python-ideas] allow `lambda' to be spelled λ
Joao S. O. Bueno
jsbueno at python.org.br
Tue Jul 12 20:00:16 EDT 2016
Stephan:
Have you met the coconut project already?
https://pypi.python.org/pypi/coconut,
http://coconut.readthedocs.io/en/master/DOCS.html
They create a superset of Python with the aim to allow writting smaller
functional programs, and have a super-featured functional set of
operators and such.
It is a pure-Python project that pre-compiles their "coconut" program
files to .py at compile time -
They have a shorter syntax for lambda already - maybe that could be of
use to you - and
maybe you can get them to accept your suggestion - it certainly would fit there.
"""
Lambdas
Coconut provides the simple, clean -> operator as an alternative to
Python’s lambda statements. The operator has the same precedence as
the old statement.
Rationale
In Python, lambdas are ugly and bulky, requiring the entire word
lambda to be written out every time one is constructed. This is fine
if in-line functions are very rarely needed, but in functional
programming in-line functions are an essential tool.
Example:
dubsums = map((x, y) -> 2*(x+y), range(0, 10), range(10, 20))
"""
More information about the Python-ideas
mailing list