Don't track frozendicts whose contents can never be tracked by the GC
Open
Nobody has claimed this yet.
interpreter-core
type-feature
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
When a frozendict is created, we can check whether all of its keys and values are objects that can never be tracked by the GC. If so, the frozendict can never be part of a reference cycle, so it can be left untracked, like gh-140232 did for frozenset. Since frozendicts are immutable, checking once at creation time is enough.
I'm preparing a PR for this.
Linked PRs
- gh-155178
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review linked PR gh-155178 first, then trace frozendict creation and its garbage-collector tracking behavior. Done means frozendicts whose keys and values can never be GC-tracked remain untracked while other frozendicts retain existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100