py-cachify 2.0.8__tar.gz → 2.0.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py-cachify
3
- Version: 2.0.8
3
+ Version: 2.0.9
4
4
  Summary: Distributed locks, caching, and locking decorators at hand
5
5
  Home-page: https://github.com/EzyGang/py-cachify
6
6
  License: MIT
@@ -14,15 +14,18 @@ _S = TypeVar('_S')
14
14
 
15
15
 
16
16
  def get_full_key_from_signature(bound_args: inspect.BoundArguments, key: str) -> str:
17
+ bound_args.apply_defaults()
18
+ _args_repr = f'{bound_args}'
19
+
17
20
  args_dict = bound_args.arguments
18
- args: Tuple[str, Any] = args_dict.pop('args', ())
21
+ args: Tuple[Any, ...] = args_dict.pop('args', ())
19
22
  kwargs: Dict[str, Any] = args_dict.pop('kwargs', {})
20
23
  kwargs.update(args_dict)
21
24
 
22
25
  try:
23
26
  return key.format(*args, **kwargs)
24
- except IndexError:
25
- raise ValueError('Arguments in a key do not match function signature') from None
27
+ except (IndexError, KeyError):
28
+ raise ValueError(f'Arguments in a key({key}) do not match function signature params({_args_repr})') from None
26
29
 
27
30
 
28
31
  def is_coroutine(
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "py-cachify"
3
- version = "2.0.8"
3
+ version = "2.0.9"
4
4
  homepage = "https://github.com/EzyGang/py-cachify"
5
5
  repository = "https://github.com/EzyGang/py-cachify"
6
6
  license = "MIT"
File without changes
File without changes