From: Daniel M. B. <da...@ba...> - 2014-12-10 00:53:03
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.
Cheers,
Daniel
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.