Disable cache support of LazyProxy.

Since Babel 1.0, there's a enable_cache keyword argument of LazyProxy,
but we can't pass it directly.
This commit is contained in:
Berker Peksag 2014-07-28 15:24:49 +03:00
parent 874439bd80
commit 15c3461b1f

View File

@ -53,9 +53,9 @@ class ReallyLazyProxy(LazyProxy):
"""
Like LazyProxy, except that it doesn't cache the value ;)
"""
@property
def value(self):
return self._func(*self._args, **self._kwargs)
def __init__(self, func, *args, **kwargs):
super(ReallyLazyProxy, self).__init__(func, *args, **kwargs)
object.__setattr__(self, '_is_cache_enabled', False)
def __repr__(self):
return "<%s for %s(%r, %r)>" % (