-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
This is copy of @TimothyZhang's stackoverflow comment
from kids.cache import cache
...
class MyClass(object):
...
@cache # <-- That's all you need to do
@property
def name(self):
return 1 + 1 # supposedly expensive calculation
This would leads to memory leak.
Create an instance c of MyClass, and inspect it with objgraph.show_backrefs([c], max_depth=10), there is a ref chain from the class object MyClass to c. That is to say, c would never been released until the MyClass been released.
Metadata
Metadata
Assignees
Labels
No labels