diff options
author | Erik Johnston <erik@matrix.org> | 2017-03-30 14:19:10 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2017-03-30 14:19:10 +0100 |
commit | 6194a64ae913aa400e19c3a9bd9348ce2bc11305 (patch) | |
tree | fe9237bf0ea255b41cbafb6487cda1047ee06b29 | |
parent | Fix up tests (diff) | |
download | synapse-6194a64ae913aa400e19c3a9bd9348ce2bc11305.tar.xz |
Doc new instance variables
-rw-r--r-- | synapse/util/caches/descriptors.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/synapse/util/caches/descriptors.py b/synapse/util/caches/descriptors.py index eed60d567e..1f02cca8a5 100644 --- a/synapse/util/caches/descriptors.py +++ b/synapse/util/caches/descriptors.py @@ -197,7 +197,6 @@ class _CacheDescriptorBase(object): arg_spec = inspect.getargspec(orig) all_args = arg_spec.args - self.arg_spec = arg_spec if "cache_context" in all_args: if not cache_context: @@ -225,8 +224,16 @@ class _CacheDescriptorBase(object): ) self.num_args = num_args + + # list of the names of the args used as the cache key self.arg_names = all_args[1:num_args + 1] + # The arg spec of the wrapped function, see `inspect.getargspec` for + # the type. + self.arg_spec = arg_spec + + # self.arg_defaults is a map of arg name to its default value for each + # argument that has a default value if arg_spec.defaults: self.arg_defaults = dict(zip( all_args[-len(arg_spec.defaults):], |