Skip to content

Investigate use of lru_cache on methods #5670

@DanielNoord

Description

@DanielNoord

Problem

I stumbled upon this video which explains problems with using lru_cache on methods as it leaks self. I haven't watched the full video yet but watched the previous video and saw the PR at pytest here: pytest-dev/pytest#9148

This is something we're doing ourselves as well and could be a potential source of memory leaks and other problems. I think this warrants an investigation and probably a refactor.

I have also opened pylint-dev/astroid#1344 to track this.


I think after the investigation of internal use it might make sense to perhaps turn this into a checker? I'll report after I have finished my investigation whether that might be useful.

Metadata

Metadata

Assignees

Labels

MaintenanceDiscussion or action around maintaining pylint or the dev workflowperformance

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions