Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
Closed
Description
Feature or enhancement
Proposal:
See e.g.the fast path using_PyLong_FromMedium() inPyLong_FromLong().PyLong_FromLongLong() is almost identical.
Maybe then implementPyLong_FromSsize_t(),PyLong_FromLong() andPyLong_FromLongLong()) using a macro similar toPYLONG_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
- gh-129149: Add Missing fast path in PYLONG_FROM_UINT macro for compact integers #129168
- gh-129149: Create a macro PYLONG_FROM_SIGNED, and leverage it in functions #129215
- gh-129149: Add fast path for medium-size integers in
PyLong_FromSsize_t()#129301 - GH-129149: Add fast paths to four more
PyLong_From*functions #131211