Aside from people who can read Greek, and some mathematicians and physicists, how is λ “more readable” than lambda? Lambda is a word that
anyone familiar with English can sound out, type, and google for. For most people, λ is a mystery symbol, as strange and exotic as Ⴋ (U+10AB).
“Shorter” is not always more readable. Do you name all your modules, functions, classes and methods one-letter names?
from c import d
v = d()
from collections import deque
values = deque()
PCs don’t type. Human beings type. How do I type the letter λ, without copying it from somewhere else, or calling up a special Character Map application, searching for lambda, and copying from that?
That’s a serious question, please answer. I’ve just been copying it from your post, which is annoying.
I doubt that reducing the keyword from six letters (lambda) to one (λ) is going to change to Python ecosystem that much. Lambdas will still be
restricted to a single expression, and mostly useful for key functions and callbacks. Just saving five letters is not going to make lambdas more useful or more popular.
On any platform, press this key sequence: L, A, M, B, D, A
Oh look! It’s easy to remember.
Why do people seem to think that memorizing codepoint numbers is an acceptable way to enter symbols?!?
If you have Compose key sequences, an AltGr key, or any other decently-memorable input method, then sure; but askiing programmers to memorize the codepoints for symbols is a TERRIBLE way to encourage adoption of a feature.
I know Julia has an editor that allows you to input special characters with a slash, so /lambda would turn into λ. I guess the idea is to make the code look more like mathmatical notation, but I think it’s a terrible idea because it encourages single-letter variable names. Not every language needs to look like APL
Oh I completely disagree with the proposal, primarily for Eric’s reason above, but you asked a question and I assumed you didn’t know the answer. Personally, I only have memorised degree ° (b0) and plus-minus ± (b1) which are useful while coding (for comments and report mark-up) in my industry.
I believed most people who use python knows what λ is as much as π. Would you say that there is difference in readability between from math import π and from math import pi? Well maybe I’m just biased, I don’t know.
λ is easy to remember and write. But so is π. And so is ≠. And Ø. Why stop at lambdas?
I feel like presumption of syntax additions as readable pseudocode expressed in ASCII is a brilliant rule of thumb that Python has, and I really hope that Python will not abandon it as it evolves. It’s extremely mentally undemanding to write, and extremely easy to read.