-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed as not planned
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirpendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedtype-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
Proposal:
I would like to ask if we need to package the addition of macro and constant for some modules in Modules/*
? I think they should be like socketmodule.c
, maybe it will be better. If allowed, I'll submit the PR. Like this:
#define ADD_INT_MACRO(MOD, INT) do { \
if (PyModule_AddIntConstant(MOD, #INT, INT) < 0) { \
goto error; \
} \
} while (0)
#ifdef AF_APPLETALK
/* Appletalk DDP */
ADD_INT_MACRO(m, AF_APPLETALK);
#endif
for example:
from posixmodule.c
#ifdef TMP_MAX
if (PyModule_AddIntMacro(m, TMP_MAX)) return -1;
#endif
#ifdef WCONTINUED
if (PyModule_AddIntMacro(m, WCONTINUED)) return -1;
#endif
from symtablemodule.c
if (PyModule_AddIntMacro(m, USE) < 0) return -1;
if (PyModule_AddIntMacro(m, DEF_GLOBAL) < 0) return -1;
I'm not sure if this is a cosmetic change, but I think it's necessary since there are only a few old modules that don't have this.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Metadata
Metadata
Assignees
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirpendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedtype-featureA feature request or enhancementA feature request or enhancement