From 064ac63da1acebd56e5bbf5ae7fe57fda8eb7bbc Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 16 Jul 2017 06:11:20 +0200 Subject: ext.lazy_property: create XYZ__reset() as soon as possible this allows using XYZ__reset from inside a lazy_property, for example to bind the reset function to a signal. See following commit --- ranger/ext/lazy_property.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/ext/lazy_property.py b/ranger/ext/lazy_property.py index c468a8c9..ccd1586e 100644 --- a/ranger/ext/lazy_property.py +++ b/ranger/ext/lazy_property.py @@ -50,9 +50,9 @@ class lazy_property(object): # pylint: disable=invalid-name,too-few-public-meth setattr(obj, self.__name__, self) del obj.__dict__[self.__name__] # force "__get__" being called + obj.__dict__[self.__name__ + "__reset"] = reset_function result = self._method(obj) obj.__dict__[self.__name__] = result - obj.__dict__[self.__name__ + "__reset"] = reset_function return result -- cgit 1.4.1-2-gfad0