[issue29534] _decimal difference with _pydecimal

2017-03-31 Thread Stefan Krah
Stefan Krah added the comment: Does anyone know how to disable the spurious pull requests that keep coming in? -- ___ Python tracker ___

[issue29534] _decimal difference with _pydecimal

2017-03-31 Thread Donald Stufft
Changes by Donald Stufft : -- pull_requests: +944 ___ Python tracker ___ ___

[issue29534] _decimal difference with _pydecimal

2017-03-17 Thread Larry Hastings
Changes by Larry Hastings : -- pull_requests: +610 ___ Python tracker ___ ___

[issue29534] _decimal difference with _pydecimal

2017-02-14 Thread Mark Dickinson
Mark Dickinson added the comment: All done. Closing. (In theory, as a bugfix, this could be backported to 3.5 and 3.6. In practice, I doubt it's worth the effort.) -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python

[issue29534] _decimal difference with _pydecimal

2017-02-14 Thread Mark Dickinson
Mark Dickinson added the comment: New changeset 996c3874fdbc91d29f0a06b37043f62cf4ead6cb by GitHub in branch 'master': Issue #29534: move Misc/NEWS entry to correct section; add Misc/ACS entry for Andrew Nester. (#99)

[issue29534] _decimal difference with _pydecimal

2017-02-14 Thread Mark Dickinson
Mark Dickinson added the comment: PR to fix the Misc/NEWS entry: https://github.com/python/cpython/pull/99 -- ___ Python tracker ___

[issue29534] _decimal difference with _pydecimal

2017-02-14 Thread Mark Dickinson
Mark Dickinson added the comment: PR merged; thank you! Unfortunately, just after I merged it I noticed that the Misc/NEWS entry was in the wrong section. I'll make a new PR to fix that, and close this issue once it's done. -- ___ Python tracker

[issue29534] _decimal difference with _pydecimal

2017-02-14 Thread Mark Dickinson
Mark Dickinson added the comment: New changeset 6d1dece06d13a7d40637e07b2c79f34aab368766 by Mark Dickinson in branch 'master': Fixed #29534 - _decimal difference with _pydecimal (#65) https://github.com/python/cpython/commit/6d1dece06d13a7d40637e07b2c79f34aab368766 --

[issue29534] _decimal difference with _pydecimal

2017-02-13 Thread Andrew Nester
Andrew Nester added the comment: thanks for your notes, it's absolutely fine and I agree with you :) -- ___ Python tracker ___

[issue29534] _decimal difference with _pydecimal

2017-02-13 Thread Mark Dickinson
Mark Dickinson added the comment: [Andrew] > it's better to fix it as other issue No, it's better not to "fix" it at all. :-) It's one of those many behaviour changes where the answer to "Should we have done this differently in the first place" might possibly be "Yes" (and might also be

[issue29534] _decimal difference with _pydecimal

2017-02-13 Thread Andrew Nester
Andrew Nester added the comment: Agree about surprising behaviour but I guess it's better to fix it as other issue because it could break BC in some cases. At least it needs to be investigated. For now I would like to stick with same behaviour for _decimal and _pydecimal --

[issue29534] _decimal difference with _pydecimal

2017-02-13 Thread Andrew Nester
Andrew Nester added the comment: actually, it's more related to subclassing, because the problem comes from the fact that before the fix __init__ method receives value as int not Decimal if int passed to from_float call. That's why only subclasses of Decimal can see difference in arguments

[issue29534] _decimal difference with _pydecimal

2017-02-13 Thread Mark Dickinson
Mark Dickinson added the comment: BTW, as a user, I'd expect `Decimal.from_float` to simply coerce its input to float if given an input that isn't actually a float in the first place; the fact that it has special handling in place for int inputs (and that that special handling takes the form

[issue29534] _decimal difference with _pydecimal

2017-02-13 Thread Mark Dickinson
Mark Dickinson added the comment: Is there an observable difference in user behaviour if no subclassing of Decimal is involved? Or does this just affect Decimal subclasses? -- ___ Python tracker

[issue29534] _decimal difference with _pydecimal

2017-02-13 Thread Andrew Nester
Andrew Nester added the comment: I've just added PR for this issue. -- nosy: +andrewnester pull_requests: +51 ___ Python tracker ___

[issue29534] _decimal difference with _pydecimal

2017-02-11 Thread Armin Rigo
Armin Rigo added the comment: Sorry! It should be repr(a) inside the print. Here is the fixed version: class X(Decimal): def __init__(self, a): print('__init__:', repr(a)) X.from_float(42.5) # __init__: Decimal('42.5') X.from_float(42) # with _pydecimal:

[issue29534] _decimal difference with _pydecimal

2017-02-11 Thread Stefan Krah
Stefan Krah added the comment: I get the the same output, perhaps I misunderstand something here: >>> from _decimal import * >>> class X(Decimal): ... def __init__(self, a): ... print('__init__:', a) ... >>> X.from_float(42.5) __init__: 42.5 Decimal('42.5') >>>

[issue29534] _decimal difference with _pydecimal

2017-02-11 Thread Stefan Krah
Changes by Stefan Krah : -- nosy: +mark.dickinson, rhettinger, skrah ___ Python tracker ___

[issue29534] _decimal difference with _pydecimal

2017-02-11 Thread Armin Rigo
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')