summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorSergey B Kirpichev <skirpichev@gmail.com>2024-03-09 20:32:05 (GMT)
committerGitHub <noreply@github.com>2024-03-09 20:32:05 (GMT)
commit1e68c4b87633b17da1b602b86f5d23bbe106398f (patch)
tree3a445ca5952ba3f6ef7d5b4a2beb5bcb2c63d86a /Doc
parentb9cb855621c0813846421e4ced97260a32e57063 (diff)
downloadcpython-1e68c4b87633b17da1b602b86f5d23bbe106398f.zip
cpython-1e68c4b87633b17da1b602b86f5d23bbe106398f.tar.gz
cpython-1e68c4b87633b17da1b602b86f5d23bbe106398f.tar.bz2
gh-111389: expose PyHASH_INF/BITS/MODULUS/IMAG macros as public (#111418)
Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/hash.rst25
1 files changed, 24 insertions, 1 deletions
diff --git a/Doc/c-api/hash.rst b/Doc/c-api/hash.rst
index 91d88ae..1cf094c 100644
--- a/Doc/c-api/hash.rst
+++ b/Doc/c-api/hash.rst
@@ -3,7 +3,7 @@
PyHash API
----------
-See also the :c:member:`PyTypeObject.tp_hash` member.
+See also the :c:member:`PyTypeObject.tp_hash` member and :ref:`numeric-hash`.
.. c:type:: Py_hash_t
@@ -17,6 +17,29 @@ See also the :c:member:`PyTypeObject.tp_hash` member.
.. versionadded:: 3.2
+.. c:macro:: PyHASH_MODULUS
+
+ The `Mersenne prime <https://en.wikipedia.org/wiki/Mersenne_prime>`_ ``P = 2**n -1``, used for numeric hash scheme.
+
+ .. versionadded:: 3.13
+
+.. c:macro:: PyHASH_BITS
+
+ The exponent ``n`` of ``P`` in :c:macro:`PyHASH_MODULUS`.
+
+ .. versionadded:: 3.13
+
+.. c:macro:: PyHASH_INF
+
+ The hash value returned for a positive infinity.
+
+ .. versionadded:: 3.13
+
+.. c:macro:: PyHASH_IMAG
+
+ The multiplier used for the imaginary part of a complex number.
+
+ .. versionadded:: 3.13
.. c:type:: PyHash_FuncDef