Use _PyLong_GetOne() and _PyLong_GetZero() in Objects #125442
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
type-feature
A feature request or enhancement
Feature or enhancement
Proposal:
There are several statements in
longobject.c
that still usesPyLong_FromLong(0L)
andPyLong_FromLong(1L)
.cpython/Objects/longobject.c
Lines 5006 to 5008 in 67f6e08
cpython/Objects/longobject.c
Line 5331 in 67f6e08
And so on.
Use
_PyLong_GetOne()
and_PyLong_GetZero()
can reduce null check and might reduce minor memory usage, as they use static caches.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:
No response
Linked PRs
The text was updated successfully, but these errors were encountered: