Skip to content

Commit

Permalink
**CI** Formatted code + Updated version number and documentation. [sk…
Browse files Browse the repository at this point in the history
…ip ci]
  • Loading branch information
github-actions[bot] committed Jun 6, 2024
1 parent f0e905c commit 0cc2101
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions dol/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,18 @@ def __set_name__(self, owner, name):
self.attrname = name
elif name != self.attrname:
raise TypeError(
"Cannot assign the same _cache_this to two different names "
f"({self.attrname!r} and {name!r})."
'Cannot assign the same _cache_this to two different names '
f'({self.attrname!r} and {name!r}).'
)
if isinstance(self.key, str):
self.cache_key = self.key
else:
assert callable(
self.key
), f"The key must be a callable or a string, not {type(self.key).__name__}."
), f'The key must be a callable or a string, not {type(self.key).__name__}.'
self.cache_key = self.key(self.attrname)
if self.cache_key is None and not self.allow_none_keys:
raise TypeError("The key returned by the key function cannot be None.")
raise TypeError('The key returned by the key function cannot be None.')

def __get_cache(self, instance):
"""
Expand Down Expand Up @@ -97,7 +97,7 @@ def __get__(self, instance, owner=None):
return self
if self.attrname is None:
raise TypeError(
"Cannot use _cache_this instance without calling __set_name__ on it."
'Cannot use _cache_this instance without calling __set_name__ on it.'
)
try:
cache = self.__get_cache(instance)
Expand All @@ -106,7 +106,7 @@ def __get__(self, instance, owner=None):
): # not all objects have __dict__ (e.g. class defines slots)
msg = (
f"No '__dict__' attribute on {type(instance).__name__!r} "
f"instance to cache {self.attrname!r} property."
f'instance to cache {self.attrname!r} property.'
)
raise TypeError(msg) from None

Expand All @@ -121,8 +121,8 @@ def __get__(self, instance, owner=None):
cache[self.cache_key] = val
except TypeError:
msg = (
f"The cache on {type(instance).__name__!r} instance "
f"does not support item assignment for caching {self.cache_key!r} property."
f'The cache on {type(instance).__name__!r} instance '
f'does not support item assignment for caching {self.cache_key!r} property.'
)
raise TypeError(msg) from None
return val
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = dol
version = 0.2.46
version = 0.2.47
url = https://github.com/i2mint/dol
platforms = any
description_file = README.md
Expand Down

0 comments on commit 0cc2101

Please sign in to comment.