This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ronaldoussoren
Recipients elfring, ronaldoussoren, vstinner
Date 2019-01-08.16:20:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1546964440.05.0.0580407180782.issue35671@roundup.psfhosted.org>
In-reply-to
Content
(changed the type from "security" because this is not a security incident).

Both ISO C and C++ define "reserved identifiers" that are reserved for the implementation and where use in programs is undefined behaviour. However, these definitions reserve *all* global symbols starting with an underscore, while such symbols are commonly used for private names in libraries. Not just in the Python implementation, but throughout the C/C++ ecosystem. 

Changing both as a large impact on the CPython implementation due to changing identifiers for private symbols, and there is no clear way to pick new names that clearly and concisely indicate that names are private (esp. not without inventing a new convention).  Such a change could also not be done for all released versions of Python (that is, for 3.8 at the earliest), which leads to an increased maintenance cost as well due to a higher chance for merge conflicts when back porting bug fixes. 

Because of this it is IMHO not worthwhile to change the names of private symbols in the CPython implementation unless there is clear evidence that a particular symbol causes problems with compilers.

That said, changing the include guard with double underscores would be fine because that name doesn't follow the regular CPython coding style.

P.S. A draft of an ISO C std: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf. Section 7.1.3 defines what reserved identifiers are.
History
Date User Action Args
2019-01-08 16:20:42ronaldoussorensetrecipients: + ronaldoussoren, vstinner, elfring
2019-01-08 16:20:40ronaldoussorensetmessageid: <1546964440.05.0.0580407180782.issue35671@roundup.psfhosted.org>
2019-01-08 16:20:40ronaldoussorenlinkissue35671 messages
2019-01-08 16:20:39ronaldoussorencreate