Skip to content

Add structured version info for decimal #157475

Description

@serhiy-storchaka

Feature or enhancement

decimal.__libmpdec_version__ (from mpd_version()) is the only information about the libmpdec library, and it only describes the library loaded at runtime. The version of the library that the module was built against is not exposed, although it can differ now that only a system libmpdec is used.

libmpdec provides MPD_VERSION, MPD_MAJOR_VERSION, MPD_MINOR_VERSION and MPD_MICRO_VERSION at compile time, and mpd_version() at runtime.

Add decimal.LIBMPDEC_VERSION and decimal.LIBMPDEC_VERSION_INFO for the build-time version, decimal.libmpdec_version as an alias of __libmpdec_version__, and decimal.libmpdec_version_info for the runtime version.

These names are specific to the C implementation and are not added to _pydecimal; the test which checks that both implementations expose the same names has to exclude them.

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.16new features, bugs and security fixesextension-modulesC modules in the Modules dirtype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions