python / cpython

The Python programming language
https://www.python.org
Other
63.59k stars 30.46k forks source link

Remove redundant small int check in long_dealloc #127119

Open eendebakpt opened 21 hours ago

eendebakpt commented 21 hours ago

Feature or enhancement

Proposal:

The python small ints are immortal with a fixed reference count. For that reason these objects can never reach reference count zero and are never deallocated. We can remove the special casing in long_dealloc. For safety we replace the check with an assert.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs