-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
gh-141004: Document Py_HASH_* macros
#141205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| .. c:macro:: Py_HASH_CUTOFF | ||
| Buffers of length in range ``[1, Py_HASH_CUTOFF)`` are hashed using DJBX33A |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll need to check if Py_HASH_CUTOFF == 1 is actually effective (at first glance, no as the interval is empty). I just used the comment in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so with 1 it's actualoly useless. Considering it's really for advanced usage, I will not change the docs here and people will see that the interval in [1, 1) is empty. But the if branch will exist and will be compiled.
ZeroIntensity
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
|
I decided to add the two blank lines around constants. Ideally I wanted sections, but I think two blank lines are better for reading the document. With so many versionadded, it's easy to get lost. |
|
I already approved this, no need to request. I'm not too familiar with this area, so I'm basically just trusting that you know what you're doing in terms of content. The format and whatnot look fine. |
| .. versionadded:: 3.4 | ||
| Add :c:macro:`!Py_HASH_FNV` and :c:macro:`!Py_HASH_SIPHASH24`. | ||
|
|
||
| .. versionadded:: 3.13 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I messed up here... it's not 3.13 but it's 3.11...
The problem is that it's named SIPHASH13!!!!
|
Well.... I included a typo :D (but that's because we have confusing names!!) I will fix it tomorrow but it will be fast (so I won't backport it yet). I knew I shouldn't have left my dev session... |
This one is much more tricky because
Py_HASH_EXTERNALwas never documented and not really supported in the configure script. It would require user-defined defines and other hacks.What I can do is remove the EXTERNAL docs and make a separate bugfix.
📚 Documentation preview 📚: https://cpython-previews--141205.org.readthedocs.build/