aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2020-05-27 21:04:08 +0200
committerGravatar Leon Sandøy <[email protected]>2020-05-27 21:04:08 +0200
commit63b81b04da3cbc4d1824e65c977ec61532dbe605 (patch)
tree4927eb3de6c39024f2694547c35b5ef74ad955db
parentRefactor typestring converters to partialmethods. (diff)
Fix ATROCIOUS comment.
I should be shot.
-rw-r--r--bot/utils/redis_cache.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/bot/utils/redis_cache.py b/bot/utils/redis_cache.py
index dd24b83e8..a71ad2191 100644
--- a/bot/utils/redis_cache.py
+++ b/bot/utils/redis_cache.py
@@ -145,9 +145,11 @@ class RedisCache:
raise TypeError(f"RedisCache._to_typestring only supports the prefixes {prefixes_string}.")
# Add some nice partials to call our generic typestring converters.
- # These are basically functions that will fill in some of the parameters for you, so that
- # any call to _key_to_typestring will be like calling _to_typestring with those two parameters
- # pre-filled.
+ # These are basically methods that will fill in some of the parameters for you, so that
+ # any call to _key_to_typestring will be like calling _to_typestring with the two parameters
+ # at `prefixes` and `types_string` pre-filled.
+ #
+ # See https://docs.python.org/3/library/functools.html#functools.partialmethod
_key_to_typestring = partialmethod(_to_typestring, prefixes=KEY_PREFIXES, types_string=KEY_TYPE_LIST)
_value_to_typestring = partialmethod(_to_typestring, prefixes=VALUE_PREFIXES, types_string=VALUE_TYPE_LIST)
_key_from_typestring = partialmethod(_from_typestring, prefixes=KEY_PREFIXES, prefixes_string=KEY_PREFIX_LIST)