GeezerVison is showing github.com — gh-115119: remove TEST_COVERAGE private macro (_decimal module) by skirpichev · Pull Request #149756 · python/cpython
Conversation
skirpichev
commented
May 13, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
This amends 9eb3b14. Use unstead Py_DEBUG.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change PR title to explain the change rather than referring to a commit sha1. Please elaborate also on why you made this change and what is its purpose.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
skirpichev
changed the title
gh-115119: amend 9eb3b146686, remove TEST_COVERAGE private macro
gh-115119: TEST_COVERAGE private macro (_decimal module)
Jun 1, 2026
skirpichev
changed the title
gh-115119: TEST_COVERAGE private macro (_decimal module)
gh-115119: remove TEST_COVERAGE private macro (_decimal module)
Jun 1, 2026
|
So, I had to reverse engineer your change...
This change no longer defines TEST_COVERAGE macro when building the _decimal extension with a Python debug build (--with-pydebug).
It seems like the TEST_COVERAGE macro was introduced by the commit 97b4121 (issue gh-94847 and PR gh-94848) to fix building the _decimal with --with-pydebug --with-lto (debug mode with LTO).
In the libmpdec-2.5.1 copy embedded in Python 3.15, I can see that the TEST_COVERAGE macro has an effect on inlining:
#if defined(_MSC_VER)
#define ALWAYS_INLINE __forceinline
#elif defined (__IBMC__) || defined(LEGACY_COMPILER)
#define ALWAYS_INLINE
#undef inline
#define inline
#else
#ifdef TEST_COVERAGE
#define ALWAYS_INLINE
#else
#define ALWAYS_INLINE inline __attribute__ ((always_inline))
#endif
#endif
The bundled copy of the libmpdec decimal library has been removed in the main branch. So it's no longer needed to define the TEST_COVERAGE variable.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
*/
|
|
|
|
|
|
#ifdef TEST_COVERAGE
|
|
|
#ifdef Py_DEBUG
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should go so far as to do this in Include/pyport.h, but that's not a decision I will be making.
Sorry, something went wrong.
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.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|