[Python-Dev] Is this safe enough? Re: [Python-checkins] cpython: _Py_Identifier are always ASCII strings

martin at v.loewis.de martin at v.loewis.de
Mon Feb 6 18:13:00 CET 2012


> I would prefer to see _Py_Identifier renamed to _Py_ASCII_Identifier,
> or at least a comment stating that Identifiers will (per PEP 3131)
> always be ASCII -- preferably with an assert to back that up.

Please ... no.

This is a *convenience* interface, whose sole purpose is to make something
more convenient. Adding naming clutter destroys this objective.

I'd rather restore support for allowing UTF-8 source here (I don't think
that requiring ASCII really improves much), than rename the macro.

The ASCII requirement is actually more in the C compiler than in Python.
Since not all of the C compilers that we compile Python with support
non-ASCII identifiers, failure to comply to the ASCII requirement will
trigger a C compilation failure.

Regards,
Martin




More information about the Python-Dev mailing list