objgraph.by_type('file', untracked=True)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 840
- Forks
- 72
- PR merge metrics
- No merged PRs in 30d
Description
So, not all objects are tracked by the Python garbage collector, and therefore not all show up in `gc.get_objects()`. For example: file objecs don't, so objgraph.by_type('file') will always return an empty list.
Implement a workaround that does
```
return [r for o in objects for r in gc.get_referents(o) if type(r).__name__ == typename]
```
if the user asks for it.
Contributor guide
No contributing guide indexed for this repository
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
Start by locating the implementation of objgraph.by_type and its existing tests. Compare current behavior with the requested untracked option, using the issue's gc.get_referents example as the expected behavior. Done means the option returns matching objects that are not included by gc.get_objects(), while existing behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100