Author Devin Jeanpierre
Recipients Devin Jeanpierre
Date 2015-01-09.03:13:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1420773186.22.0.229704657455.issue23201@psf.upfronthosting.co.za>
In-reply-to
Content
>>> import decimal
>>> x = 0
>>> y = float(x)
>>> z = decimal.Decimal(x)
>>> x == y == z == x
True
>>> x ** x
1
>>> y**y
1.0
>>> z**z
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/decimal.py", line 2216, in __pow__
    return context._raise_error(InvalidOperation, '0 ** 0')
  File "/usr/lib/python2.7/decimal.py", line 3872, in _raise_error
    raise error(explanation)
decimal.InvalidOperation: 0 ** 0

This is PHP-like and confusing, and maybe not justified just by standards compliance. If it is justified by standards compliance, this deserves to be spelled out in big red letters in the documentation for the decimal module, along with any other inconsistencies.
History
Date User Action Args
2015-01-09 03:13:06Devin Jeanpierresetrecipients: + Devin Jeanpierre
2015-01-09 03:13:06Devin Jeanpierresetmessageid: <1420773186.22.0.229704657455.issue23201@psf.upfronthosting.co.za>
2015-01-09 03:13:06Devin Jeanpierrelinkissue23201 messages
2015-01-09 03:13:05Devin Jeanpierrecreate