[Python-checkins] r86635 - in python/branches/py3k: Lib/decimal.py Lib/test/test_decimal.py Misc/NEWS

raymond.hettinger python-checkins at python.org
Sun Nov 21 05:08:29 CET 2010


Author: raymond.hettinger
Date: Sun Nov 21 05:08:28 2010
New Revision: 86635

Log:
Revert  r86517

Modified:
   python/branches/py3k/Lib/decimal.py
   python/branches/py3k/Lib/test/test_decimal.py
   python/branches/py3k/Misc/NEWS

Modified: python/branches/py3k/Lib/decimal.py
==============================================================================
--- python/branches/py3k/Lib/decimal.py	(original)
+++ python/branches/py3k/Lib/decimal.py	Sun Nov 21 05:08:28 2010
@@ -943,7 +943,7 @@
         # in the documentation.  (See library docs, 'Built-in Types').
         if self._is_special:
             if self.is_snan():
-                raise ValueError('Cannot hash a signaling NaN value.')
+                raise TypeError('Cannot hash a signaling NaN value.')
             elif self.is_nan():
                 return _PyHASH_NAN
             else:

Modified: python/branches/py3k/Lib/test/test_decimal.py
==============================================================================
--- python/branches/py3k/Lib/test/test_decimal.py	(original)
+++ python/branches/py3k/Lib/test/test_decimal.py	Sun Nov 21 05:08:28 2010
@@ -1346,7 +1346,7 @@
 
         #the same hash that to an int
         self.assertEqual(hashit(Decimal(23)), hashit(23))
-        self.assertRaises(ValueError, hash, Decimal('sNaN'))
+        self.assertRaises(TypeError, hash, Decimal('sNaN'))
         self.assertTrue(hashit(Decimal('Inf')))
         self.assertTrue(hashit(Decimal('-Inf')))
 

Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS	(original)
+++ python/branches/py3k/Misc/NEWS	Sun Nov 21 05:08:28 2010
@@ -172,9 +172,6 @@
 
 - Issue #10465: fix broken delegating of attributes by gzip._PaddedFile.
 
-- Issue #10356: hash(Decimal("sNaN")) now raises ValueError instead of
-  TypeError.
-
 - Issue #10356: Decimal.__hash__(-1) should return -2.
 
 - Issue #1553375: logging: Added stack_info kwarg to display stack information.


More information about the Python-checkins mailing list