8000 cachetools.func doesn't work · Issue #5617 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

cachetools.func doesn't work #5617

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

Closed
Akuli opened this issue Jun 11, 2021 · 2 comments · Fixed by #5690
Closed

cachetools.func doesn't work #5617

Akuli opened this issue Jun 11, 2021 · 2 comments · Fixed by #5690
Labels
stubs: false positive Type checkers report false errors

Comments

@Akuli
Copy link
Collaborator
Akuli commented Jun 11, 2021

Works at runtime, two mypy errors:

from cachetools.func import ttl_cache
@ttl_cache(ttl=0.100, maxsize=10)  # Argument 1 has incompatible type "Callable[[str], int]"; expected <nothing>
def foo(lol: str) -> int:
    return int(lol)

print(foo("123"))  # <nothing> not callable

But it works if I change the first lines to this:

from cachetools import cached, TTLCache
@cached(TTLCache(ttl=0.100, maxsize=10))
@srittau srittau added the stubs: false positive Type checkers report false errors label Jun 11, 2021
@srittau
Copy link
Collaborator
srittau commented Jun 11, 2021

We should try using Callable[[_F], _F] directly, instead of using _RET[_F].

@hauntsaninja
Copy link
Collaborator
hauntsaninja commented Jun 11, 2021

Same deal as #5482 (and broken by the same change)

gkoller added a commit to Amsterdam/dataservices-airflow that referenced this issue Jun 22, 2021
Version >= 0.900 has a number of issues that bite use:
- python/typeshed#5617
- it doesn't honor `# type: ignore[misc]` in those circumstances
gkoller added a commit to Amsterdam/dataservices-airflow that referenced this issue Jun 22, 2021
Version >= 0.900 has a number of issues that bite use:
- python/typeshed#5617
- it doesn't honor `# type: ignore[misc]` in those circumstances
gkoller added a commit to Amsterdam/dataservices-airflow that referenced this issue Jun 22, 2021
Version >= 0.900 has a number of issues that bite use:
- python/typeshed#5617
- it doesn't honor `# type: ignore[misc]` in those circumstances
gkoller added a commit to Amsterdam/dataservices-airflow that referenced this issue Jun 22, 2021
Version >= 0.900 has a number of issues that bite use:
- python/typeshed#5617
- it doesn't honor `# type: ignore[misc]` in those circumstances
gkoller added a commit to Amsterdam/dataservices-airflow that referenced this issue Jun 22, 2021
Version >= 0.900 has a number of issues that bite use:
- python/typeshed#5617
- it doesn't honor `# type: ignore[misc]` in those circumstances
8000
gkoller added a commit to Amsterdam/dataservices-airflow that referenced this issue Jun 22, 2021
Version >= 0.900 has a number of issues that bite use:
- python/typeshed#5617
- it doesn't honor `# type: ignore[misc]` in those circumstances
gkoller added a commit to Amsterdam/dataservices-airflow that referenced this issue Jun 22, 2021
Version >= 0.900 has a number of issues that bite use:
- python/typeshed#5617
- it doesn't honor `# type: ignore[misc]` in those circumstances
gkoller added a commit to Amsterdam/dataservices-airflow that referenced this issue Jun 22, 2021
Version >= 0.900 has a number of issues that bite use:
- python/typeshed#5617
- it doesn't honor `# type: ignore[misc]` in those circumstances
gkoller added a commit to Amsterdam/dataservices-airflow that referenced this issue Jun 22, 2021
Version >= 0.900 has a number of issues that bite use:
- python/typeshed#5617
- it doesn't honor `# type: ignore[misc]` in those circumstances
gkoller added a commit to Amsterdam/dataservices-airflow that referenced this issue Jun 22, 2021
Version >= 0.900 has a number of issues that bite use:
- python/typeshed#5617
- it doesn't honor `# type: ignore[misc]` in those circumstances
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stubs: false positive Type checkers report false errors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
0