Feature or enhancement
Proposal:
See e.g. the fast path using_PyLong_FromMedium() in PyLong_FromLong(). PyLong_FromLongLong() is almost identical.
Maybe then implement PyLong_FromSsize_t(), PyLong_FromLong() and PyLong_FromLongLong()) using a macro similar to PYLONG_FROM_UINT to get rid of the repetitive code?
PYLONG_FROM_UINT is missing the fast path for medium values, too.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
Per encouragement from @iritkatriel in #128927 (comment)
Linked PRs
Feature or enhancement
Proposal:
See e.g. the fast path using_PyLong_FromMedium() in
PyLong_FromLong().PyLong_FromLongLong()is almost identical.Maybe then implement
PyLong_FromSsize_t(),PyLong_FromLong()andPyLong_FromLongLong()) using a macro similar to PYLONG_FROM_UINT to get rid of the repetitive code?PYLONG_FROM_UINT is missing the fast path for medium values, too.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
Per encouragement from @iritkatriel in #128927 (comment)
Linked PRs
PyLong_FromSsize_t()#129301PyLong_From*functions #131211