Hacker News new | ask | show | jobs
by kungato 2128 days ago
How is this terrible? Isn't this pretty standard in all big languages?
2 comments

It is decidedly undesireable for "⋄˄∕≡·‒⁇⁆․⌉⌋"[1] to be a valid indentifier. Especially if, as appears to be the case, "foo[⋄˄/≡·-⁇].⌉⌋"[0] is a valid expression.

0: foo[diamond_caret / indentical_middot - questionquestion ] . ceil_floor

1: utf8: E2 8B 84 CB 84 E2 88 95 E2 89 A1 CE 87 E2 80 92 E2 81 87 E2 81 86 E2 80 A4 E2 8C 89 E2 8C 8B

I know you can use emoji as variables in Ruby. Unsure if you can in Python.

Imo it's fine to allow Unicode. Latin will still be the de facto standard character set, but it allows international users to code natively and allows for Easter eggs.

Since PEP 3131 (https://www.python.org/dev/peps/pep-3131/) Python supports unicode in names, but only letters, not emoji. I have occasionally used variable names like ϕ when transcribing a formula in toy code.

The unicode is normalized. That can be used for trickery in rare circumstances. "global" is a keyword, but "𝐠𝐥𝐨𝐛𝐚𝐥" isn't, so you can use that if you absolutely require an attribute called "global".