[issue29534] _decimal difference with _pydecimal

Armin Rigo report at bugs.python.org
Sat Feb 11 08:54:15 EST 2017


New submission from Armin Rigo:

A difference in behavior between _decimal and _pydecimal (it seems that _decimal is more consistent in this case):

    class X(Decimal):
        def __init__(self, a):
            print('__init__:', a)
    X.from_float(42.5)   # __init__: Decimal('42.5')

    X.from_float(42)     # with _pydecimal: __init__: 42
                         # with _decimal:   __init__: Decimal('42')

----------
messages: 287600
nosy: arigo
priority: normal
severity: normal
status: open
title: _decimal difference with _pydecimal
type: behavior
versions: Python 3.5, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29534>
_______________________________________


More information about the Python-bugs-list mailing list