We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0360e9f commit 21412d0Copy full SHA for 21412d0
Include/internal/pycore_global_strings.h
@@ -372,6 +372,16 @@ struct _Py_global_strings {
372
#define _Py_STR(NAME) \
373
(_Py_SINGLETON(strings.literals._ ## NAME._ascii.ob_base))
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. */
385
#define _Py_DECLARE_STR(name, str)
386
387
#ifdef __cplusplus
0 commit comments