Mark Dickinson added the comment:
Just had a quick look at numbers.py. Only two comments:
1. I think there's a typo in the docstring for Inexact: one of those == should
be a !=
2. Not that it really matters now, but note that at least for Decimal, x-y is
not the same
as x+(-y) (I'm looking at Complex.__sub__), and +x is not a no-op (Real.real,
Real.conjugate). In both cases signs of zeros can be problematic:
>>> x = Decimal('-0')
>>> y = Decimal('0')
>>> x-y
Decimal("-0")
>>> x+(-y)
Decimal("0")
>>> x
Decimal("-0")
>>> +x
Decimal("0")
Of course the first point wouldn't matter anyway since Decimal already
implements __sub__;
the second means that if Decimal were to join Real, something would need to be
done to
avoid Decimal("-0").real becoming Decimal("0").
__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1682>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com