Ezio Melotti <[email protected]> added the comment: Valid identifiers should begin with a letter or '_' and contain only letters, numbers and '_'. This probably means that only the Unicode characters that belong to the categories Ll, Lu (Letter Lower/Upper case), Nd (Number, Decimal Digit) and Pc (Punctuation, Connector) - and possibly other categories like Lm, Lt, No and Nl - are valid.
Some examples: >>> a-b = 5 # U+FF0D, Cat: Pd, FULLWIDTH HYPHEN-MINUS SyntaxError: invalid character in identifier >>> a# = 5 # U+FF03, Cat: Po, FULLWIDTH NUMBER SIGN SyntaxError: invalid character in identifier >>> a)b = 5 # U+FF09, Cat: Pe, FULLWIDTH RIGHT PARENTHESIS SyntaxError: invalid character in identifier >>> a_b = 5 # U+FF3F, Cat: Pc, FULLWIDTH LOW LINE >>> a_b 5 >>> a﹍b﹎c﹏d = 5 # U+FE4D, U+FE4E, U+FE4F, Cat: Pc >>> a﹍b﹎c﹏d 5 _______________________________________ Python tracker <[email protected]> <http://bugs.python.org/issue5358> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
