Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-40521: Always create the empty tuple singleton #21116

Merged
merged 1 commit into from
Jun 24, 2020
Merged

bpo-40521: Always create the empty tuple singleton #21116

merged 1 commit into from
Jun 24, 2020

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jun 24, 2020

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().

https://bugs.python.org/issue40521

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().
@vstinner vstinner merged commit 0430dfa into python:master Jun 24, 2020
@vstinner vstinner deleted the tuple_empty branch June 24, 2020 13:21
fasih pushed a commit to fasih/cpython that referenced this pull request Jun 29, 2020
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().
arun-mani-j pushed a commit to arun-mani-j/cpython that referenced this pull request Jul 21, 2020
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().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants