Skip to content

Commit

Permalink
Mention public macros in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
skirpichev committed Oct 29, 2023
1 parent 0ce377a commit 2c6002f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,8 @@ made available to Python as the :attr:`modulus` attribute of
.. impl-detail::

Currently, the prime used is ``P = 2**31 - 1`` on machines with 32-bit C
longs and ``P = 2**61 - 1`` on machines with 64-bit C longs.
longs and ``P = 2**61 - 1`` on machines with 64-bit C longs. The exponent
of this Mersenne prime is available as ``_PyHASH_BITS`` macro.

Here are the rules in detail:

Expand Down
9 changes: 6 additions & 3 deletions Doc/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1022,19 +1022,22 @@ always available.

.. attribute:: hash_info.modulus

The prime modulus P used for numeric hash scheme
The prime modulus P used for numeric hash scheme. Available also as
``_PyHASH_MODULUS`` macro.

.. attribute:: hash_info.inf

The hash value returned for a positive infinity
The hash value returned for a positive infinity. Available also as
``_PyHASH_INF`` macro.

.. attribute:: hash_info.nan

(This attribute is no longer used)

.. attribute:: hash_info.imag

The multiplier used for the imaginary part of a complex number
The multiplier used for the imaginary part of a complex number.
Available also as ``_PyHASH_IMAG`` macro.

.. attribute:: hash_info.algorithm

Expand Down

0 comments on commit 2c6002f

Please sign in to comment.