-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Generic type is not inferred across descriptor class methods #8516
Comments
This works as expected if you change |
We definitely should not crash. It might be nice if we have an unused type variable in a method to note the class may need to inherit from Generic. |
Thanks for such a quick response. You guys rock! |
This doesn't crash any more on master. Here's the output I get:
|
Tried to write type stubs for lazy package.
Lazy
provides a descriptor that invokes the underlying method only once and caches the result in the instance.The inferred type is
<nothing>
, so mypy crashes when checking expressions.If lazy was defined as a function, type gets inferred correctly.
The text was updated successfully, but these errors were encountered: