Skip to content

Commit 8541273

Browse files
committed
revert changes
1 parent e121d01 commit 8541273

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

async_lru/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ async def __call__(self, /, *fn_args: _P.args, **fn_kwargs: _P.kwargs) -> _R:
216216
self.__cache[key] = _CacheItem(fut, None)
217217

218218
if self.__maxsize is not None and len(self.__cache) > self.__maxsize:
219-
self.__cache.popitem(last=False)[1].cancel()
219+
dropped_key, cache_item = self.__cache.popitem(last=False)
220+
cache_item.cancel()
220221

221222
self._cache_miss(key)
222223
return await asyncio.shield(fut)
@@ -227,12 +228,12 @@ def __get__(self, instance: Any, owner: None) -> Self:
227228

228229
@overload
229230
def __get__(
230-
self, instance: _T, owner: Type[Any]
231+
self, instance: _T, owner: Type[_T]
231232
) -> "_LRUCacheWrapperInstanceMethod[_P, _R, _T]":
232233
...
233234

234235
def __get__(
235-
self, instance: Any, owner: Optional[Type[Any]]
236+
self, instance: _T, owner: Optional[Type[_T]]
236237
) -> Union[Self, "_LRUCacheWrapperInstanceMethod[_P, _R, _T]"]:
237238
if owner is None:
238239
return self

0 commit comments

Comments
 (0)