-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
PEP 757: Rename endian to endianness #3973
Conversation
* Remove the "Optimize small integers" section. * Elaborate on PyLong_GetNativeLayout() validity. * Mention PyLong_FreeExport() in the specification.
@skirpichev: I don't think that the "Optimize small integers" section is still relevant since we added |
That's a request of @pitrou. |
On Wed, Sep 18, 2024 at 01:48:26AM -0700, Victor Stinner wrote:
***@***.***: I don't think that the "Optimize small integers" section
is still relevant since we added PyLongExport.value. What do you think?
I think it's still relevant for writing API. The GMPy_PyLong_From_MPZ()
has special case with PyLong_FromLong().
|
On Wed, Sep 18, 2024 at 01:48:48AM -0700, Victor Stinner wrote:
Rename endian to endianness
That's a request of ***@***.***
I'm still unsure about fate of PyLongLayout and co, but it's good to
keep things in sync with the pr.
I'm planning to format API sections as sphinx docs from the pr.
|
@vstinner, maybe you can update benchmarks for export? See python/cpython#121339 (comment). With latest changes, something like third one is relevant. |
Ok, but is it worth it to mention it in the PEP? The gmpy code uses GMP functions for that:
I don't understand. Do you want to modify this PR?
I updated benchmarks with results that I got locally. My benchmark doesn't look very reliable since the reference timings changed as well. But well, it should give an idea of the performance. |
Yes, but the point is to fallback on PyLong_FromLong() to avoid generic code.
No, it's big enough:)
I don't expect that there are some recent changes in gmpy2, that might affect timings on this area. |
Mark Shannon asked to include also reference code in some form. We can, for example, provide hyperlinks to github. mpz_set_PyLong: GMPy_PyLong_From_MPZ: |
I restored the "small integer" section, but rephrased it only for the import API. |
I let you create a PR if you want to add that. |
📚 Documentation preview 📚: https://pep-previews--3973.org.readthedocs.build/