diff options
author | hut <hut@hut.pm> | 2017-07-16 06:11:20 +0200 |
---|---|---|
committer | hut <hut@hut.pm> | 2017-07-16 06:11:20 +0200 |
commit | 064ac63da1acebd56e5bbf5ae7fe57fda8eb7bbc (patch) | |
tree | b1f2d1865d579f860920e3c0dd02da372f44f396 /ranger | |
parent | fbf6d83a65317944f08e62e60e412bebe573c25d (diff) | |
download | ranger-064ac63da1acebd56e5bbf5ae7fe57fda8eb7bbc.tar.gz |
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
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/ext/lazy_property.py | 2 |
1 files changed, 1 insertions, 1 deletions
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 |