This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients mark.dickinson, skrah
Date 2009-11-08.00:14:43
SpamBayes Score 0.0
Marked as misclassified No
Message-id <1257639285.87.0.108618121853.issue7278@psf.upfronthosting.co.za>
In-reply-to
Content
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 that seems to expect that Decimal(x) 
always returns a copy.  I'm not quite sure why that test is there, 
though it may be because Decimal instances weren't always as immutable 
as they are now (some of the non-__new__ methods used to modify the 
Decimal fields directly).  In my opinion that test could be removed, but 
I'd like to consult with some of the other Decimal authors before doing 
so.

(An aside: it's important to note that operations on Decimal subclasses 
should always return *Decimal* instances, not instances of the subclass.
So any code like:

  if isinstance(x, Decimal): return x

should be regarded with suspicion.)

N.B. Some of your recent reports seem more like questions about the 
implementation rather than reports of possible bugs in Python;  I'm not 
sure that the bug tracker is the best medium for this.  python-dev might 
be more appropriate, or I'm happy to answer private emails.
History
Date User Action Args
2009-11-08 00:14:45mark.dickinsonsetrecipients: + mark.dickinson, skrah
2009-11-08 00:14:45mark.dickinsonsetmessageid: <1257639285.87.0.108618121853.issue7278@psf.upfronthosting.co.za>
2009-11-08 00:14:44mark.dickinsonlinkissue7278 messages
2009-11-08 00:14:43mark.dickinsoncreate