[issue7278] decimal.py: New instance vs. new reference

2009-11-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: Stefan, this is a non-guaranteed implementation detail (for both ints and decimals). -- nosy: +rhettinger resolution: -> invalid status: open -> closed ___ Python tracker _

[issue7278] decimal.py: New instance vs. new reference

2009-11-07 Thread Mark Dickinson
Mark Dickinson added the comment: I don't think it should matter whether either 'id(x) == id(y)' returns True or False: since both ints and Decimals are regarded as immutable, the implementation should be free to reuse (or not) existing objects at will. There is a test in test_decimal.py th

[issue7278] decimal.py: New instance vs. new reference

2009-11-07 Thread Stefan Krah
Changes by Stefan Krah : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue7278] decimal.py: New instance vs. new reference

2009-11-07 Thread Stefan Krah
New submission from Stefan Krah : In the following case, Decimal() and int() behave differently. I wonder if this is intentional: >>> from decimal import * >>> x = Decimal(2) >>> y = Decimal(x) >>> id(x) == id(y) False >>> >>> x = int(2) >>> y = int(x) >>> id(x) == id(y) True >>> -- me