Why asci-only symbols?

"Martin v. Löwis" martin at v.loewis.de
Wed Oct 12 04:56:44 EDT 2005


Mike Meyer wrote:
> Out of random curiosity, is there a PEP/thread/? that explains why
> Python symbols are restricted to 7-bit ascii?

No PEP yet; I meant to write one for several years now.

The principles would be
- sources must use encoding declarations
- valid identifiers would follow the Unicode consortium guidelines,
   in particular: identifiers would be normalized in NFKC (I think),
   adjusted in the ASCII range for backward compatibility (i.e.
   not introducing any additional ASCII characters as legal identifier
   characters)
- __dict__ will contain Unicode keys
- all objects should support Unicode getattr/setattr (potentially
   raising AttributeError, of course)
- open issue: what to do on the C API (perhaps nothing, perhaps
   allowing UTF-8)

Regards,
Martin



More information about the Python-list mailing list