Re: [SQLObject] caching an expensive property
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2014-12-10 10:32:42
|
Hi! On Wed, Dec 10, 2014 at 12:33:03AM +0000, Daniel Monteiro Basso <da...@ba...> wrote: > For recent Python versions (>2.7 I guess), you could have also written like: > with self.__cache_lock: > do_stuff > return self.__cache > The context protocol takes care of the rest. Yes, in 2.6+. > Cheers, > Daniel Oleg. -- Oleg Broytman http://phdru.name/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |