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