Uh oh!
There was an error while loading. Please reload this page.
gh-111230: Fix _ssl.c not checking for errors when initializing a module - #111232
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
serhiy-storchaka
left a comment
There was a problem hiding this comment.
LGTM, but I would prefer to not use ALL_CAPS for macro parameters (here, and in your other PRs). It is very unusual (and perhaps against PEP 7). Please only use ALL_CAPS for macro names.
sobolevn
commented
Oct 25, 2023
@serhiy-storchaka I think that this is the style suggested and prefered by @erlend-aasland, I am ok with both. |
There is no mention of macro arguments in PEP-7; please do not spread uncertainty and doubt like this. I personally prefer ALL_CAPS macro parameters since it makes them stand out better from implicit variables that are not part of the macro "scope"; for example, many macros are used in extension module initialisation phase, and very often, the module object is implicitly used from within the macro. Using ALL_CAPS macro parameters makes it clear that these parameters are text strings (and not variables) that will be replaced by the pre-processor. Also, note that this style is used other places in the code base by other core devs. |
Thanks @sobolevn for the PR, and @erlend-aasland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Thanks @sobolevn for the PR, and @erlend-aasland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, @sobolevn and @erlend-aasland, I could not cleanly backport this to |
Sorry, @sobolevn and @erlend-aasland, I could not cleanly backport this to |
bedevere-bot
commented
Oct 25, 2023
|
serhiy-storchaka
commented
Oct 25, 2023
Indeed, PEP 7 does not specify it explicitly. But all examples in PEP 7 and AFAIK all existing macros write parameter names in lower case. If some macros write it in upper case, it perhaps a new tendency, I never seen this before. I think that it should be specified in PEP 7 explicitly. |
serhiy-storchaka
commented
Oct 25, 2023
I created a new discussion for this: https://discuss.python.org/t/all-caps-for-macro-parameter-names/37119. |
erlend-aasland
commented
Oct 26, 2023
I agree.
Thanks! |
hugovk
commented
Nov 9, 2023
@sobolevn@erlend-aasland Does this still need backporting? If not, let's close #111230. |
vstinner
commented
Nov 9, 2023
Introduce ADD_INT_CONST macro wrapper for PyModule_AddIntConstant()
Introduce ADD_INT_CONST macro wrapper for PyModule_AddIntConstant()
I've used
_PyModule_ADD_INT_CONSTmacro name to make the diff minimal:PyModule_AddIntConstant_ssl.cdoes not handle errors on module creation #111230