From cc09f6c962c33661d764fd7a1234830516c94872 Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Sun, 2 Sep 2018 14:37:22 -0700 Subject: [PATCH] Fix doc issues in configcache --- qutebrowser/config/configcache.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/qutebrowser/config/configcache.py b/qutebrowser/config/configcache.py index 7187b822a..c9e23ff66 100644 --- a/qutebrowser/config/configcache.py +++ b/qutebrowser/config/configcache.py @@ -17,20 +17,22 @@ # You should have received a copy of the GNU General Public License # along with qutebrowser. If not, see . -"""A 'high-performance' cache for the config system. -Useful for areas which call out to the config system very frequently, DO NOT -modify the value returned, DO NOT require per-url settings, do not change -frequently, and do not require partially 'expanded' config paths. - -If any of these requirements are broken, you will get incorrect or slow -behavior. -""" +"""Implementation of a basic config cache.""" from qutebrowser.config import config class ConfigCache(): + """A 'high-performance' cache for the config system. + + Useful for areas which call out to the config system very frequently, DO + NOT modify the value returned, DO NOT require per-url settings, do not + change frequently, and do not require partially 'expanded' config paths. + + If any of these requirements are broken, you will get incorrect or slow + behavior. + """ def __init__(self) -> None: self.cache = {} @@ -40,7 +42,7 @@ class ConfigCache(): if attr in self.cache: self.cache[attr] = config.instance.get(attr) - def __setitem__(self, attr): + def __setitem__(self, attr, _value): raise Exception("ConfigCache cannot be used to set values.") def __getitem__(self, attr: str):