Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee=Noneclosed_at=<Date2016-11-22.06:04:38.269>created_at=<Date2016-11-21.09:40:15.884>labels= ['interpreter-core', 'type-feature', '3.7']
title='Add the const qualifier to fields name and doc of public structs'updated_at=<Date2017-03-31.16:36:34.032>user='https://github.com/serhiy-storchaka'
Proposed patch makes the fields name and doc of structures PyMemberDef, PyGetSetDef, PyStructSequence_Field, PyStructSequence_Desc, and wrapperbase being of type "const char *" rather of "char *".
These structures often are initialized as static variables and name and doc fields are initialized from literal strings. These fields are always refer to constant string literal, NULL, or readonly UTF8 representation of a Unicode object. They are never refer to mutable data. Changing the data referred by these pointers is an error. Adding the const qualifier makes clear that this is an immutable data.
This change may need some changes in third-party code. But it needs to change only one line in CPython sources, and I believe that most third-party projects don't need any changes at all.