Skip to content

Need to update cachetools decorator type stub with paramspec #4849

Description

@judej

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]: ...

Activity

  1. srittau commented on Dec 28, 2020

    @srittau
    Collaborator

    Depends on #4827.

  2. AlexWaygood commented on Jun 12, 2022

    @AlexWaygood
    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.

  3. AlexWaygood commented on Jun 14, 2022

    @AlexWaygood
    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions