8000 bpo-34100: compile: Re-enable frozenset merging by methane · Pull Request #10760 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-34100: compile: Re-enable frozenset merging #10760

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

Merged
merged 4 commits into from
Nov 28, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Resurrect special casing empty frozenset
  • Loading branch information
methane committed Nov 28, 2018
commit 86d305e08ce78024cc487404c35e2b4748b98be6
3 changes: 3 additions & 0 deletions Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,9 @@ merge_consts_recursive(struct compiler *c, PyObject *o)
assert(PyTuple_GET_SIZE(key) == 2);

Py_ssize_t len = PySet_GET_SIZE(o);
if (len == 0) { // empty frozenset should not be re-created.
return key;
}
PyObject *tuple = PyTuple_New(len);
if (tuple == NULL) {
Py_DECREF(key);
Expand Down
0