-
-
Notifications
You must be signed in to change notification settings - Fork 382
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
mypy infers attrs.fields(type(attrs_instance))
as Any
#1297
Comments
attrs.fields(type(foo))
as Any
attrs.fields(type(attrs_instance))
as Any
There's probably a difference between Will close this here. |
@Tinche I was just about to file a report about pyright believing FWIW, as an end user of attrs encountering unexpected behaviour when type checking, it didn't occur to me that a type checker might effectively ignore the This leads to two questions: Q1: Why do the stubs record the return type of Q2: Is there value in systematically marking each place in the I'd consider putting in the legwork to add those annotations as a PR, but I may need some guidance depending on how literate the mypy+plugin code is. I'm happy to file separate issues if you feel that's best. |
Like you mentioned, the Pyright folks aren't amenable to bespoke attrs support. I don't think there's much point bending our type hints to accomodate non-Mypy use cases at this time. Pretty sure Pyright will accept |
mypy infers
attrs.fields(type(foo))
asAny
But mypy infers
attrs.fields(Foo)
just fineIs it possible to have mypy infer the type of
attrs.fields(type(foo))
?The text was updated successfully, but these errors were encountered: