-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Casted type from typing.cast()
is ignored (no-member
)
#4534
Comments
@postlund thanks for the report. Could you try without the call to cast? It would determine if the problem is linked to the inference of cast function or to the wave module. |
@hippo91 I get the same error if I remove the cast by the looks of it. |
It looks to me like there's no logic currently to infer the result of the I had a go at implementing this here, I think this will need a bit of work to make it more rigorous but it seems like it works in a simple case. |
@timmartin, could you open a PR in astroid please ? Apparently bad inference in cast is not at fault for this issue, but this is still a nice feature to have :) |
I will open a PR, I just wanted to do a little more review of the code first, it's probably not ready to merge. If I'm understanding this correctly, lack of inference on |
typing.cast()
is ignored (no-member
)
See discussion at pylint-dev/astroid#1076 (comment) for subtle issues with |
Steps to reproduce
Given a file
a.py
:Current behavior
Result of
pylint a.py
:Expected behavior
No warnings expected.
mypy
does not give any errors.pylint --version output
Result of
pylint --version
output:The text was updated successfully, but these errors were encountered: