Skip to content

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

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 1 commit into from
Dec 7, 2020

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