Skip to content
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

There are some deficiencies in automatic completion #3374

Closed
ydmykr opened this issue Sep 21, 2022 · 2 comments
Closed

There are some deficiencies in automatic completion #3374

ydmykr opened this issue Sep 21, 2022 · 2 comments
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@ydmykr
Copy link

ydmykr commented Sep 21, 2022

fileA.py

import astropy.units as u

class A:
    def __init__(a: int = 1, b: u.Quantity[u.yr] = 0*u.yr) -> None:
        pass

fileB.py

import astropy.units as u

from fileA import A


class B(A):

If I type init and use autocomplete. Pylance will give me the following code:

    def __init__(a: int = 1, b: u.Quantity[u.yr] = ...) -> None:
        super().__init__(b)

However, I want autocomplete can recognize 0*u.yr in A instead of ...

@erictraut
Copy link
Contributor

Thanks for the bug report. This will be fixed in an upcoming version of pylance.

@erictraut erictraut added bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version and removed triage-needed labels Sep 21, 2022
erictraut pushed a commit to microsoft/pyright that referenced this issue Sep 21, 2022
…ss expression forms in a parameter's default value expression. This addresses microsoft/pylance-release#3374.
@debonte
Copy link
Contributor

debonte commented Sep 22, 2022

This issue has been fixed in prerelease version 2022.9.31, which we've just released. You can find the changelog here: CHANGELOG.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version
Projects
None yet
Development

No branches or pull requests

3 participants