Commit 21412d0 1 parent 0360e9f commit 21412d0 Copy full SHA for 21412d0
File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -372,6 +372,16 @@ struct _Py_global_strings {
372
372
#define _Py_STR (NAME ) \
373
373
(_Py_SINGLETON (strings .literals ._ ## NAME ._ascii .ob_base ))
374
374
375
+ /* _Py_DECLARE_STR() should precede all uses of _Py_STR() in a function.
376
+
377
+ This is true even if the same string has already been declared
378
+ elsewhere, even in the same file. Mismatched duplicates are detected
379
+ by Tools/scripts/generate-global-objects.py.
380
+
381
+ Pairing _Py_DECLARE_STR() with every use of _Py_STR() makes sure the
382
+ string keeps working even if the declaration is removed somewhere
383
+ else. It also makes it clear what the actual string is at every
384
+ place it is being used. */
375
385
#define _Py_DECLARE_STR (name , str )
376
386
377
387
#ifdef __cplusplus
You can’t perform that action at this time.
0 commit comments