Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to update cachetools decorator type stub with paramspec #4849

Closed
judej opened this issue Dec 22, 2020 · 3 comments
Closed

Need to update cachetools decorator type stub with paramspec #4849

judej opened this issue Dec 22, 2020 · 3 comments

Comments

@judej
Copy link

judej commented Dec 22, 2020

In https://github.com/python/typeshed/blob/master/third_party/2and3/cachetools/decorators.pyi, ParamSpec needs to be added to the Callable and ContextManager params

def cached(
    cache: Optional[MutableMapping[_KT, _VT]], key: Callable[..., _KT] = ..., lock: Optional[ContextManager[_T_co]] = ...
) -> Callable[[_T], _T]: ...
@srittau
Copy link
Collaborator

srittau commented Dec 28, 2020

Depends on #4827.

@AlexWaygood
Copy link
Member

ParamSpec can now be used in most situations, but I'm not immediately sure how the cachetools stub can be improved with ParamSpec. (PRs to improve our cachetools stubs are of course welcome!)

The linked pylance issue seems to be to do with functools.lru_cache, not our third-party cachetools stubs.

@AlexWaygood
Copy link
Member

ParamSpec can now be used in most situations, but I'm not immediately sure how the cachetools stub can be improved with ParamSpec. (PRs to improve our cachetools stubs are of course welcome!)

The linked pylance issue seems to be to do with functools.lru_cache, not our third-party cachetools stubs.

Closing as per my comments above, but feel free to open a new issue (or, better yet, a PR) if there are indeed still issues with our cachetools stubs :)

Issues around functools.lru_cache are being discussed in depth at #6347 and #7771 already.

@AlexWaygood AlexWaygood closed this as not planned Won't fix, can't repro, duplicate, stale Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants