File tree Expand file tree Collapse file tree 5 files changed +11
-3
lines changed
Expand file tree Collapse file tree 5 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -182,10 +182,13 @@ type.
182182 +-----------+------------------+-----------------------------------------+
183183
184184
185- .. c :var :: char * PyStructSequence_UnnamedField
185+ .. c :var :: const char * const PyStructSequence_UnnamedField
186186
187187 Special value for a field name to leave it unnamed.
188188
189+ .. versionchanged :: 3.9
190+ The type was changed from ``char * ``.
191+
189192
190193.. c :function :: PyObject* PyStructSequence_New (PyTypeObject *type)
191194
Original file line number Diff line number Diff line change @@ -215,6 +215,9 @@ Build and C API Changes
215215 way to call a callable Python object without any argument.
216216 (Contributed by Victor Stinner in :issue: `37194 `.)
217217
218+ * The global variable :c:data: `PyStructSequence_UnnamedField ` is now a constant
219+ and refers to a constant string.
220+ (Contributed by Serhiy Storchaka in :issue: `38650 `.)
218221
219222
220223Deprecated
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ typedef struct PyStructSequence_Desc {
1919 int n_in_sequence ;
2020} PyStructSequence_Desc ;
2121
22- extern char * PyStructSequence_UnnamedField ;
22+ extern const char * const PyStructSequence_UnnamedField ;
2323
2424#ifndef Py_LIMITED_API
2525PyAPI_FUNC (void ) PyStructSequence_InitType (PyTypeObject * type ,
Original file line number Diff line number Diff line change 1+ The global variable :c:data: `PyStructSequence_UnnamedField ` is now a
2+ constant and refers to a constant string.
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ static const char unnamed_fields_key[] = "n_unnamed_fields";
1818
1919/* Fields with this name have only a field index, not a field name.
2020 They are only allowed for indices < n_visible_fields. */
21- char * PyStructSequence_UnnamedField = "unnamed field" ;
21+ const char * const PyStructSequence_UnnamedField = "unnamed field" ;
2222_Py_IDENTIFIER (n_sequence_fields );
2323_Py_IDENTIFIER (n_fields );
2424_Py_IDENTIFIER (n_unnamed_fields );
You can’t perform that action at this time.
0 commit comments