Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use the Python-specificPy_DEBUG macro rather than_DEBUG in Windows-related C code #131942

Closed
Labels
@XuehaiPan

Description

@XuehaiPan

Follow the discussion at#131799 (comment).

Currently, the Windows-related C code is mixed using the Python-specificPy_DEBUG macro and non-Python-specific_DEBUG macro.

The documentation said_DEBUG impliesPy_DEBUG.

Py_DEBUG

Compiling the interpreter with thePy_DEBUG macro defined produces what is generally meant bya debug build of Python. Py_DEBUG is enabled in the Unix build by adding--with-pydebug to the./configure command. It is also implied by the presence of the not-Python-specific_DEBUG macro. WhenPy_DEBUG is enabled in the Unix build, compiler optimization is disabled.

And it is guaranteed by the following code on Windows.

#ifdef_DEBUG
# definePy_DEBUG
#endif

All platform-non-specific code and Unix-specific code is using the Python-specificPy_DEBUG macro. It would be nice to usePy_DEBUG in Windows-related C code either. It could improve the code readability and maintainability.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp