8000 Fix cachetools decorators by JHeilCoveo · Pull Request #5690 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

Fix cachetools deco 8000 rators #5690

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

Merged
merged 1 commit into from
Jun 25, 2021

Conversation

JHeilCoveo
Copy link
Contributor
@JHeilCoveo JHeilCoveo commented Jun 25, 2021

What

Fix cachetools' decorators by using IdentiyFunction. I based this PR off #5482.

Why

This simple code currently fails

from cachetools.func import ttl_cache


@ttl_cache(ttl=1)
def simple(a: int) -> int:
    return a + 1


if __name__ == "__main__":
    print(simple(1))

With following error messages :

simple.py:12: error: Argument 1 has incompatible type "Callable[[int], int]"; expected
simple.py:18: error: not callable

Fixes #5617

@JelleZijlstra JelleZijlstra merged commit 64c85cd into python:master Jun 25, 2021
@JHeilCoveo JHeilCoveo deleted the fix/cachetools-decorators branch August 19, 2021 14:57
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

Successfully merging this pull request may close these issues.

cachetools.func doesn't work
2 participants
0