Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 86d305e

Browse files
committedNov 28, 2018
Resurrect special casing empty frozenset
1 parent 7a520e4 commit 86d305e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎Python/compile.c

+3
Original file line numberDiff line numberDiff line change
@@ -1252,6 +1252,9 @@ merge_consts_recursive(struct compiler *c, PyObject *o)
12521252
assert(PyTuple_GET_SIZE(key) == 2);
12531253

12541254
Py_ssize_t len = PySet_GET_SIZE(o);
1255+
if (len == 0) { // empty frozenset should not be re-created.
1256+
return key;
1257+
}
12551258
PyObject *tuple = PyTuple_New(len);
12561259
if (tuple == NULL) {
12571260
Py_DECREF(key);

0 commit comments

Comments
 (0)
Please sign in to comment.