Add structured version info for decimal
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
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
- gh-157476
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the C implementation of decimal and the _pydecimal implementation, then inspect the existing mpd_version() and libmpdec_version handling. Check the test that requires both implementations to expose the same names; done means the requested build-time and runtime names are exposed by the C implementation and the parity test excludes them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100