Mercurial > hgrepos > Python > libs > ConfigMix
changeset 526:48990863b905
Rename internal cache from __cache to __lookup_cache
| author | Franz Glasner <f.glasner@feldmann-mg.com> |
|---|---|
| date | Mon, 20 Dec 2021 12:45:48 +0100 |
| parents | be6ef72c55d5 |
| children | 08924499db3c |
| files | configmix/config.py |
| diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/configmix/config.py Mon Dec 20 12:43:17 2021 +0100 +++ b/configmix/config.py Mon Dec 20 12:45:48 2021 +0100 @@ -334,12 +334,12 @@ # # PY2.7 compat: must be set before calling the superclass' __init__ # - self.__cache = {} + self.__lookup_cache = {} super(Configuration, self).__init__(*args, **kwds) def clear_cache(self): """Clear the internal lookup cache""" - self.__cache.clear() + self.__lookup_cache.clear() def __getitem__(self, key): """Mapping and list interface that forwards to :meth:`~.getvarl_s` @@ -678,7 +678,7 @@ """ if not path: return self - v = self.__cache.get(path, _MARKER) + v = self.__lookup_cache.get(path, _MARKER) if v is not _MARKER: if v is _MISSING: raise KeyError( @@ -692,14 +692,14 @@ for p in path[1:]: v = eiref(v[p]) except TypeError: - self.__cache[path] = _MISSING + self.__lookup_cache[path] = _MISSING raise KeyError( "Configuration variable %r not found" "(missing intermediate keys?)" % (path,)) except KeyError: - self.__cache[path] = _MISSING + self.__lookup_cache[path] = _MISSING raise - self.__cache[path] = v + self.__lookup_cache[path] = v return v def _lookupref(self, key):
