22
33from abc import ABC , abstractmethod
44from asyncio import gather
5+ from collections .abc import AsyncGenerator , Iterable
56from typing import TYPE_CHECKING , Any , NamedTuple , Protocol , runtime_checkable
67
78if TYPE_CHECKING :
89 from collections .abc import AsyncGenerator , Iterable
10+ from types import TracebackType
911 from typing import Any , TypeAlias
1012
1113 from typing_extensions import Self
@@ -42,7 +44,7 @@ class Store(ABC):
4244 _mode : AccessMode
4345 _is_open : bool
4446
45- def __init__ (self , mode : AccessModeLiteral = "r" , * args : Any , ** kwargs : Any ):
47+ def __init__ (self , mode : AccessModeLiteral = "r" , * args : Any , ** kwargs : Any ) -> None :
4648 self ._is_open = False
4749 self ._mode = AccessMode .from_literal (mode )
4850
@@ -56,7 +58,12 @@ def __enter__(self) -> Self:
5658 """Enter a context manager that will close the store upon exiting."""
5759 return self
5860
59- def __exit__ (self , * args : Any ) -> None :
61+ def __exit__ (
62+ self ,
63+ exc_type : type [BaseException ] | None ,
64+ exc_value : BaseException | None ,
65+ traceback : TracebackType | None ,
66+ ) -> None :
6067 """Close the store."""
6168 self .close ()
6269
@@ -171,7 +178,7 @@ async def _set_many(self, values: Iterable[tuple[str, Buffer]]) -> None:
171178 Insert multiple (key, value) pairs into storage.
172179 """
173180 await gather (* (self .set (key , value ) for key , value in values ))
174- return None
181+ return
175182
176183 @property
177184 @abstractmethod
0 commit comments