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

This doesn't appear to work with python>=3.6 type hints #2

Closed
saml-dev opened this issue Feb 18, 2019 · 9 comments
Closed

This doesn't appear to work with python>=3.6 type hints #2

saml-dev opened this issue Feb 18, 2019 · 9 comments

Comments

@saml-dev
Copy link

As of python 3.6, type hints have changed from

client = boto3.client('ssm')  # type: botostubs.SSM

to

client: botostubs.SSM = boto3.client('ssm')

and I can't get it to work in VS code. I never used it in python 3.5 so I'm not sure if the new type hints are the issue or it's just not working with my vscode for some other reason, but I wanted to rule out the type hint format change.

@jeshan
Copy link
Owner

jeshan commented Feb 19, 2019

This package has nothing IDE-specific, it's a regular PyPI package like any other.
Here it is working in my Intellij IDEA:
image

Please check if type hints from other packages work. If it doesn't, see if others are experiencing the same issue in the VS Code issue tracker.

Let me know how it goes.

@jeshan
Copy link
Owner

jeshan commented Feb 28, 2019

any news @SamLewis0602 ?

@saml-dev
Copy link
Author

Sorry, I haven't had time to figure this out and likely won't soon. Feel free to close this and I can always reopen it once I've got more info. Your screenshot has convinced me that it's something with my environment, I just haven't had the time to dig in and figure out what it is 😁

@jeshan jeshan closed this as completed Feb 28, 2019
@saml-dev
Copy link
Author

saml-dev commented Mar 1, 2019

These two images confirm that type hints are working in vscode in general:

image

image

However, I don't get anything from the botostubs type hint.
image
I have the latest versions of boto* libraries as of today:

boto3                    1.9.105           
botocore                 1.12.105          
botostubs                0.4.1.9.105 

Any thoughts?

@saml-dev
Copy link
Author

saml-dev commented Mar 1, 2019

I just discovered, if I enable Jedi as the Intellisense engine in settings (just search jedi in settings to find it) then the botostubs methods work. So this appears to be an issue with type hints. It also looks like they have an as-of-yet unreleased fix here: microsoft/python-language-server#546

@jeshan
Copy link
Owner

jeshan commented Mar 3, 2019 via email

@pcgeek86
Copy link

I got this working by disabling the Jedi Intellisense engine, opting for the Microsoft Python Language Server instead. That's accomplished by adding the following to my user settings JSON configuration.

    "python.jediEnabled": false

Also, I posted the issue with the botostubs over on the Jedi project. Hopefully they'll be able to fix it. It's hard to say if it's an issue with Jedi or the Python extension for Visual Studio Code.

davidhalter/jedi#1341

@RajenDharmendra
Copy link

The best way to get work done in VS code
go to settings --> search for jedi ---> disable it

Reload the editor and you can get the functionality

@RajenDharmendra
Copy link

The above workaround is for VS code using botostubs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants