GitHub · Where software is built | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

_decimal and _pydecimal compatibility differences #117056

Open
@antonok-edm

Description

@antonok-edm

Bug report

Bug description:

There are two backends for the decimal module, one from libmpdec (_decimal) and the other being a native re-implementation in Python (_pydecimal).

The signatures of methods like Decimal.__add__ take a named context argument when imported from _pydecimal, but cannot accept that argument when imported from _decimal.

mpdecimal is not bundled with Python installations on all platforms, and my understanding is that there are even more changes to how it's packaged incoming as per #115119. The difference between the two backends has caused cross-platform incompatibility for at least one project, and I'd argue it's very difficult for anyone who encounters this problem to understand the issue because the error messages mention nothing about an external dependency being required.

Would it be possible to remove the context argument from the _pydecimal backend, or to add it to the _decimal backend even if it's unused, to resolve the incompatibility?

CPython versions tested on:

3.11

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

Labels

type-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    TMZ Celebrity News – Breaking Stories, Videos & Gossip

    Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

    Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

    🎥 Watch TMZ Live

    TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.