# Feature or enhancement ### Proposal: See e.g. [the fast path using_PyLong_FromMedium()](https://github.com/python/cpython/blob/5aaf41685834901e4ed0a40f4c055b92991a0bb5/Objects/longobject.c#L329-L331) 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](https://github.com/python/cpython/blob/5aaf41685834901e4ed0a40f4c055b92991a0bb5/Objects/longobject.c#L357-L379) to get rid of the repetitive code? [PYLONG_FROM_UINT](https://github.com/python/cpython/blob/5aaf41685834901e4ed0a40f4c055b92991a0bb5/Objects/longobject.c#L357-L379) 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 https://github.com/python/cpython/pull/128927#discussion_r1924265225 <!-- gh-linked-prs --> ### Linked PRs * gh-129168 * gh-129215 * gh-129301 * gh-131211 <!-- /gh-linked-prs -->