]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-42536: GC track recycled tuples (GH-23623)
authorBrandt Bucher <brandtbucher@gmail.com>
Sat, 5 Dec 2020 03:45:57 +0000 (19:45 -0800)
committerGitHub <noreply@github.com>
Sat, 5 Dec 2020 03:45:57 +0000 (19:45 -0800)
commit226a012d1cd61f42ecd3056c554922f359a1a35d
tree86407049a5d2c22b0ce8626407ca106eb3c26afd
parent2de5097ba4c50eba90df55696a7b2e74c93834d4
bpo-42536: GC track recycled tuples (GH-23623)

Several built-in and standard library types now ensure that their internal result tuples are always tracked by the garbage collector:

- collections.OrderedDict.items
- dict.items
- enumerate
- functools.reduce
- itertools.combinations
- itertools.combinations_with_replacement
- itertools.permutations
- itertools.product
- itertools.zip_longest
- zip

Previously, they could have become untracked by a prior garbage collection.
12 files changed:
Lib/test/test_builtin.py
Lib/test/test_dict.py
Lib/test/test_enumerate.py
Lib/test/test_itertools.py
Lib/test/test_ordered_dict.py
Misc/NEWS.d/next/Core and Builtins/2020-12-02-20-23-31.bpo-42536.Kx3ZOu.rst [new file with mode: 0644]
Modules/_functoolsmodule.c
Modules/itertoolsmodule.c
Objects/dictobject.c
Objects/enumobject.c
Objects/odictobject.c
Python/bltinmodule.c