Skip to content

Include debug/release and optimization level in the Python build/version line #137151

@disconnect3d

Description

@disconnect3d

Hi,

When discussing issues like this one and printing out Python lines etc. it would be nice if the given CPython build line like this:

Python 3.15.0a0 (heads/main:c6e6fe92cd8, Jul 20 2025, 13:06:47) [GCC 13.3.0] on linux

would include information regarding how the given CPython version was compiled: whether it uses LTO, whether --enable-optimizations was enabled etc.

Maybe we could have some letters like: O for optimized, L for LTO, P for PGO, B for LLVM's BOLT? Maybe even O{1,2,3} for -O{1,2,3} if we allow for choosing this.

Additionally, we could have some _testcapi.compiler_options string?

Has this already been discussed elsewhere?

I am not sure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions