Open
Description
Feature
on CPython 3.10:
$ python
Python 3.10.1 (main, Dec 18 2021, 23:53:45) [GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> ð¦ = 0
File "<stdin>", line 1
ð¦ = 0
^
SyntaxError: invalid character 'ð¦' (U+1F980)
on RustPython 0.1.2:
$ ./rustpython
Welcome to the magnificent Rust Python 0.1.2 interpreter ð± ð
>>>>> ð¦ = 0
>>>>> ð¦
0
According to python doc, valid identifiers are defined as:
identifier ::= xid_start xid_continue*
id_start ::= <all characters in general categories Lu, Ll, Lt, Lm, Lo, Nl, the underscore, and characters with the Other_ID_Start property>
id_continue ::= <all characters in id_start, plus characters in the categories Mn, Mc, Nd, Pc and others with the Other_ID_Continue property>
xid_start ::= <all characters in id_start whose NFKC normalization is in "id_start xid_continue*">
xid_continue ::= <all characters in id_continue whose NFKC normalization is in "id_continue*">
The Unicode category codes mentioned above stand for:
Lu - uppercase letters
Ll - lowercase letters
Lt - titlecase letters
Lm - modifier letters
Lo - other letters
Nl - letter numbers
Mn - nonspacing marks
Mc - spacing combining marks
Nd - decimal numbers
Pc - connector punctuations
Other_ID_Start - explicit list of characters in PropList.txt to support backwards compatibility
Other_ID_Continue - likewise
While Ferris-chan ð¦ (U+1F980) is not included above, it should probably not be considered a valid variable name?
Python Documentation
Metadata
Metadata
Assignees
Labels
No labels

