[Python-checkins] r88160 - python/branches/py3k/Doc/whatsnew/3.2.rst

raymond.hettinger python-checkins at python.org
Mon Jan 24 10:17:24 CET 2011


Author: raymond.hettinger
Date: Mon Jan 24 10:17:24 2011
New Revision: 88160

Log:
Add entry for hash_info().


Modified:
   python/branches/py3k/Doc/whatsnew/3.2.rst

Modified: python/branches/py3k/Doc/whatsnew/3.2.rst
==============================================================================
--- python/branches/py3k/Doc/whatsnew/3.2.rst	(original)
+++ python/branches/py3k/Doc/whatsnew/3.2.rst	Mon Jan 24 10:17:24 2011
@@ -1106,6 +1106,14 @@
    assert hash(Fraction(3, 2)) == hash(1.5) == \
           hash(Decimal("1.5")) == hash(complex(1.5, 0))
 
+Some of the hashing details are exposed through a new attribute,
+:attr:`sys.hash_info`, which describes the bit width of the hash value, the
+prime modulus, the hash values for *infinity* and *nan*, and the multiplier
+used for the imaginary part of a number:
+
+>>> sys.hash_info
+sys.hash_info(width=64, modulus=2305843009213693951, inf=314159, nan=0, imag=1000003)
+
 An early decision to limit the inter-operability of various numeric types has
 been relaxed.  It is still unsupported (and ill-advised) to have implicit
 mixing in arithmetic expressions such as ``Decimal('1.1') + float('1.1')``


More information about the Python-checkins mailing list