Skip to content

Commit

Permalink
pyright...
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeshardmind committed Apr 4, 2024
1 parent f849845 commit 0872f6c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions async_utils/task_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from functools import partial
from typing import Any, ParamSpec, TypeVar

from ._cpython_stuff import make_key # type: ignore
from ._cpython_stuff import make_key

__all__ = ("taskcache",)

Expand Down Expand Up @@ -63,7 +63,11 @@ def wrapped(*args: P.args, **kwargs: P.kwargs) -> asyncio.Task[T]:
internal_cache.pop,
key,
)
task.add_done_callback(call_after_ttl)
task.add_done_callback(call_after_ttl) # pyright: ignore[reportArgumentType]
# call_after_ttl is incorrectly determined to be a function taking a single argument
# with the same type as the value type of internal_case
# dict.pop *has* overloads for this, but the lack of bidirectional inference
# with functools.partial use in pyright breaks this.
return task

return wrapped
Expand Down

0 comments on commit 0872f6c

Please sign in to comment.