-
Notifications
You must be signed in to change notification settings - Fork 767
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
[Downgrade] - Returning self no longer has proper type annotations #1927
Comments
I have edited the issue, but it might not be visible enough, adding it here: |
Thanks for the bug report. I've created a tracking bug in the pyright repo, and I'll investigate further. |
This will be fixed in the next release. |
@erictraut Thanks, may I know when will next release be ? Will close after I update the version and check the bug is fixed |
We release pylance weekly, typically on Wednesdays. We'll close the issue once the new version is published. |
This issue has been fixed in version 2021.10.1, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#2021101-14-october-2021 |
Today I noticed something is wrong with the annotation of codes, lot of codes and variables are marked as
Any
(white color), I have iterated the possible cause of this can it was due toreturn self
in anasync
method defined in parent classes. It does not annotate properlyself
when it is extended, it keeps annotatingself
as the parent class. See image:Note: this only happens to
async
methods, non-async methods works as expected.Environment data
Language server version: 2021.10.0
Pylance version: v2021.10.0
Python version: 3.8.7
OS: win10
Expected behaviour
Variable
o
in image is annotated asB
instead of~A
Actual behaviour
Variable
o
in image is annotated as~A
Impact potential
it basically disables the ability of autocompletion after using a parent defined async method returning self, because it is annotated as the parent class, it does not have access to extended class attributes.
Code snippet of the image
Temporary Fix
EDIT: Downgrading Pylance to version v2021.9.4 fixes this aswell. Peraphs the easiest fix
This does not justify as a "expected behavior", it functions with normal python methods but not coroutine methods
The text was updated successfully, but these errors were encountered: