FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-115119: remove TEST_COVERAGE private macro (_decimal module) by skirpichev · Pull Request #149756 · python/cpython · GitHub

/ cpython Public

gh-115119: remove TEST_COVERAGE private macro (_decimal module) - #149756

Merged
zware merged 1 commit into
python:mainfrom
skirpichev:amend-pr133964
Jun 1, 2026
Merged

gh-115119: remove TEST_COVERAGE private macro (_decimal module)#149756
zware merged 1 commit into
python:mainfrom
skirpichev:amend-pr133964

Conversation

skirpichev commented May 13, 2026
edited
Loading

Copy link
Copy Markdown
Member

This amends 9eb3b14. Use unstead Py_DEBUG.

Copy link
Copy Markdown
Member Author

CC @zware, @vstinner

vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

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
skirpichev requested a review from vstinner June 1, 2026 13:35

vstinner commented Jun 1, 2026

Copy link
Copy Markdown
Member

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.

vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

*/

#ifdef TEST_COVERAGE
#ifdef Py_DEBUG

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

zware merged commit 59abdf8 into python:main Jun 1, 2026
61 checks passed
skirpichev deleted the amend-pr133964 branch June 1, 2026 21:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL