Skip to content

Commit adb27bd

Browse files
committed
improve hash docs
1 parent 8cec3d3 commit adb27bd

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Doc/c-api/hash.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,16 @@ See also the :c:member:`PyTypeObject.tp_hash` member and :ref:`numeric-hash`.
5656
it is easier to create colliding strings. A cutoff of 7 on 64-bit platforms
5757
and 5 on 32-bit platforms should provide a decent safety margin.
5858

59+
This corresponds to the :data:`sys.hash_info.cutoff` constant.
60+
5961
.. versionadded:: 3.4
6062

6163

6264
.. c:macro:: PyHASH_MODULUS
6365
6466
The `Mersenne prime <https://en.wikipedia.org/wiki/Mersenne_prime>`_ ``P = 2**n -1``,
6567
used for numeric hash scheme.
68+
6669
This corresponds to the :data:`sys.hash_info.modulus` constant.
6770

6871
.. versionadded:: 3.13
@@ -71,7 +74,6 @@ See also the :c:member:`PyTypeObject.tp_hash` member and :ref:`numeric-hash`.
7174
.. c:macro:: PyHASH_BITS
7275
7376
The exponent ``n`` of ``P`` in :c:macro:`PyHASH_MODULUS`.
74-
This corresponds to the :data:`sys.hash_info.hash_bits` constant.
7577

7678
.. versionadded:: 3.13
7779

@@ -86,6 +88,7 @@ See also the :c:member:`PyTypeObject.tp_hash` member and :ref:`numeric-hash`.
8688
.. c:macro:: PyHASH_INF
8789
8890
The hash value returned for a positive infinity.
91+
8992
This corresponds to the :data:`sys.hash_info.inf` constant.
9093

9194
.. versionadded:: 3.13
@@ -94,6 +97,7 @@ See also the :c:member:`PyTypeObject.tp_hash` member and :ref:`numeric-hash`.
9497
.. c:macro:: PyHASH_IMAG
9598
9699
The multiplier used for the imaginary part of a complex number.
100+
97101
This corresponds to the :data:`sys.hash_info.imag` constant.
98102

99103
.. versionadded:: 3.13
@@ -111,14 +115,20 @@ See also the :c:member:`PyTypeObject.tp_hash` member and :ref:`numeric-hash`.
111115
112116
Hash function name (UTF-8 encoded string).
113117

118+
This corresponds to the :data:`sys.hash_info.algorithm` constant.
119+
114120
.. c:member:: const int hash_bits
115121
116122
Internal size of the hash value in bits.
117123

124+
This corresponds to the :data:`sys.hash_info.hash_bits` constant.
125+
118126
.. c:member:: const int seed_bits
119127
120128
Size of seed input in bits.
121129

130+
This corresponds to the :data:`sys.hash_info.seed_bits` constant.
131+
122132
.. versionadded:: 3.4
123133

124134

0 commit comments

Comments
 (0)