[Python-ideas] allow `lambda' to be spelled λ
Sven R. Kunze
srkunze at mail.de
Wed Jul 13 06:43:56 EDT 2016
On 13.07.2016 10:51, Paul Moore wrote:
> On 13 July 2016 at 05:00, Steven D'Aprano <steve at pearwood.info> wrote:
>> Not too many people like Cobol-like spelling:
>>
>> add 1 to the_number
>>
>> over "n += 1". So I think that arguments for keeping "traditional
>> spelling" are mostly about familiarity. If we learned lambda calculus in
>> high school, perhaps λ would be less exotic.
> It's probably also relevant in this context that more "modern"
> languages tend to avoid the term lambda but embrace "anonymous
> functions" with syntax such as
>
> (x, y) -> x+y
>
> or whatever.
>
> So while "better syntax for lambda expressions" is potentially a
> reasonable goal, I don't think that perpetuating the concept/name
> "lambda" is necessary or valuable.
Exactly, there's not much value in having yet another way of writing
'lambda:'. Keeping other languages in mind and the conservative stance
Python usually takes, the arrow ('=>') would be the only valid
alternative for a "better syntax for lambda expressions". However, IIRC,
this has been debated and won't happen.
Personally, I have other associations with λ. Thus, I would rather see
it as a variable name in such contexts.
>
> Paul
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
More information about the Python-ideas
mailing list