3 ms·
Given that Python allows unicode characters in source, I'm surprised it doesn't allow lambda to be replaced by the λ character.
by cabalamat 6y ago
Given that Python allows unicode characters in source, I'm surprised it doesn't allow lambda to be replaced by the λ character.
- alrs 6y agoI'm surprised that you're surprised.
- JNRowe 6y agoFor those, like me, who get excited by this note that there are restrictions on the Unicode categories that are allowed, see the supported characters¹ and gory details². It is often enough to write math-y code in a usable way, but occasionally you'll find you can't use the character you want. ¹ https://docs.python.org/3/reference/lexical_analysis.html#identifiers https://docs.python.org/3/reference/lexical_analysis.html#id... ² https://www.python.org/dev/peps/pep-3131/ https://www.python.org/dev/peps/pep-3131/
- dragonwriter 6y agoThat would be quite unpythonic. Down that road lies Raku. EDIT: To be clear, I like Raku. But Python has its own distinct aesthetic.
- OJFord 6y agoWell you can't do `l = lambda` to replace it either, it's not really anything to do with allowing full unicode identifiers.