-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed as not planned
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
Proposal:
There are several statements in longobject.c
that still uses PyLong_FromLong(0L)
and PyLong_FromLong(1L)
.
Lines 5006 to 5008 in 67f6e08
z = (PyLongObject *)PyLong_FromLong(1L); | |
if (z == NULL) | |
goto Error; |
Line 5331 in 67f6e08
return PyLong_FromLong(0); |
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
eendebakpt
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement