[issue21145] Add the @cached_property decorator

Antoine Pitrou report at bugs.python.org
Mon May 19 00:40:23 CEST 2014


Antoine Pitrou added the comment:

> Will that implementation cause a memory leak? Won't the lru_cache have
> a dict mapping {self: result}, meaning that `self` will live forever,
> instead of storing result in self.__dict__, where the lifetimes are
> correct.

Oh, you're right. Sorry for the noise.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21145>
_______________________________________


More information about the Python-bugs-list mailing list