]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-40521: Always create the empty tuple singleton (GH-21116)
authorVictor Stinner <vstinner@python.org>
Wed, 24 Jun 2020 13:21:54 +0000 (15:21 +0200)
committerGitHub <noreply@github.com>
Wed, 24 Jun 2020 13:21:54 +0000 (15:21 +0200)
commit0430dfac629b4eb0e899a09b899a494aa92145f6
tree5d71dc3e81dcd38f88e14157c0048c9acd705a29
parent80526f68411a9406a9067095fbf6a0f88047cac5
bpo-40521: Always create the empty tuple singleton (GH-21116)

Py_InitializeFromConfig() now always creates the empty tuple
singleton as soon as possible.

Optimize PyTuple_New(0): it no longer has to check if the empty tuple
was created or not, it is always creatd.

* Add tuple_create_empty_tuple_singleton() function.
* Add tuple_get_empty() function.
* Remove state parameter of tuple_alloc().
Include/internal/pycore_pylifecycle.h
Objects/tupleobject.c
Python/pylifecycle.c