Skip to content

[3.9] bpo-42536: GC track recycled tuples (GH-23623)#23651

Merged
pablogsal merged 1 commit intopython:3.9from
brandtbucher:backport-226a012-3.9
Dec 7, 2020
Merged

[3.9] bpo-42536: GC track recycled tuples (GH-23623)#23651
pablogsal merged 1 commit intopython:3.9from
brandtbucher:backport-226a012-3.9

Conversation

@brandtbucher
Copy link
Member

@brandtbucher brandtbucher commented Dec 5, 2020

CC @pablogsal, just to make sure I'm doing the manual backport with cherry_picker correctly (automatic backporting failed).

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.
(cherry picked from commit 226a012)

https://bugs.python.org/issue42536

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.
(cherry picked from commit 226a012)
@pablogsal pablogsal merged commit 60463e8 into python:3.9 Dec 7, 2020
@brandtbucher brandtbucher deleted the backport-226a012-3.9 branch July 21, 2022 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants