-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Module 'functools' has no attribute 'cached_property' #4198
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
Comments
This was fixed in #3439, which was released by mypy a while ago. Are you running mypy with |
Ah, interesting, that works! I was not specifying the minor version, why is that necessary? Does mypy imply some other minor version if I don't specify it? |
Could you share the command you're running? mypy doesn't allow you to specify only the major version. If you don't specify anything, mypy will use the version of |
Closing, as I believe there aren't any changes to be made on typeshed's side — but feel free to post / reopen if you're still having trouble! |
Hi @hauntsaninja , I tried with the argument suggested by @JelleZijlstra and it worked. It's surprising that even running it under Python 3.8 requires me to provide that argument, but IMO that's not a big issue, provided that it works I'm fine with that. Cheers! |
Note: if you are reporting a wrong signature of a function or a class in
the standard library, then the typeshed tracker is better suited
for this report: https://github.com/python/typeshed/issues
Please provide more information to help us understand the issue:
Are you reporting a bug, or opening a feature request?
Reporting a bug.
Please insert below the code you are checking with mypy,
or a mock-up repro if the source is private. We would appreciate
if you try to simplify your case to a minimal repro.
from functools import cached_property
What is the actual behavior/output?
mypy check error:
Module 'functools' has no attribute 'cached_property'
- the code however runs just fine.What is the behavior/output you expect?
That mypy succeeds with that line, instead of failing, since the attribute does exist.
What are the versions of mypy and Python you are using?
mypy 0.770, CPython 3.8.3
Do you see the same issue after installing mypy from Git master?
Yes.
What are the mypy flags you are using? (For example --strict-optional)
No flags.
The text was updated successfully, but these errors were encountered: