From b486e73b084f1d1308986e48966eaa95ea41abea Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Mon, 16 Dec 2024 09:53:33 -0800 Subject: [PATCH] ruff --- python/selfie-lib/selfie_lib/CacheSelfie.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/python/selfie-lib/selfie_lib/CacheSelfie.py b/python/selfie-lib/selfie_lib/CacheSelfie.py index e05a4424..25430d8a 100644 --- a/python/selfie-lib/selfie_lib/CacheSelfie.py +++ b/python/selfie-lib/selfie_lib/CacheSelfie.py @@ -33,17 +33,23 @@ def cache_selfie( else: raise TypeError("Invalid arguments provided to cache_selfie") + def cache_selfie_json(to_cache: Callable[..., T]) -> "CacheSelfie[T]": return cache_selfie(to_cache, Roundtrip.json()) + @overload -def cache_selfie_binary(to_cache: Callable[..., bytes]) -> "CacheSelfieBinary[bytes]": ... +def cache_selfie_binary( + to_cache: Callable[..., bytes], +) -> "CacheSelfieBinary[bytes]": ... + @overload def cache_selfie_binary( to_cache: Callable[..., T], roundtrip: Roundtrip[T, bytes] ) -> "CacheSelfieBinary[T]": ... + def cache_selfie_binary( to_cache: Union[Callable[..., bytes], Callable[..., T]], roundtrip: Optional[Roundtrip[T, bytes]] = None, @@ -57,6 +63,7 @@ def cache_selfie_binary( else: raise TypeError("Invalid arguments provided to cache_selfie") + class CacheSelfie(Generic[T]): def __init__( self,