-
-
Notifications
You must be signed in to change notification settings - Fork 248
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
Linting error: account.inbox.filter(...)
#1276
Comments
I think this is just Pyright not being able to understand the code properly. I don't see anything wrong. |
Just opened an issue at Pyright: microsoft/pyright#7378 |
Welp, pyright is blaming this repo for the error. Looking myself, it looks like it is perhaps an issue here. I think maybe we just need to export the list of attributes in an |
pydanny/cached-property#172 is probably real issue. threaded_cached_property doesn't play well with static analysis tools in general. The easiest trick, if TYPE_CHECKING:
my_prop = property
else:
my_prop = threaded_cached_property |
Most of exchangelib was written long before type annotations became a Python feature. Adding full annotations is a huge effort that I will not undertake myself, at least. |
I wasn't suggesting that we need full annotations; I do however thing that it makes sense to add hints on parts that are being labelled as errors |
In this case, it looks like the real issue lies in the cached-property package. I think the issue should be solved there. There are other places where static type checkers have a hard time reasoning about exchangelib code. I haven't seen any cases where there were actual errors, and refactoring turned out to be a lot of work for very little gain. I'm closing this issue because exchangelib doesn't use Pyright. I'm not generally opposed to doing so, but please work on adding support in a PR instead. |
@ecederstrand, would you be willing to help me write an issue for this in the |
The issue already exists. pydanny/cached-property#172 is the correct issue. Fixing that will fix the problem here. |
Describe the bug
The following code gives a linting error:
This code runs fine, but the
.filter
part ofaccount.inbox.filter(...)
gets the following linting error in Pyright:Additional context
Python 3.9, exchangelib 5.1.0
The text was updated successfully, but these errors were encountered: