Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

No completions for sys.exc_info with latest typeshed #434

Closed
huguesv opened this issue Nov 27, 2018 · 4 comments
Closed

No completions for sys.exc_info with latest typeshed #434

huguesv opened this issue Nov 27, 2018 · 4 comments
Assignees

Comments

@huguesv
Copy link
Contributor

huguesv commented Nov 27, 2018

With the bundled typeshed on Python 3, you get completions/info tips on these variables:

import sys
e1, e2, e3 = sys.exc_info()

But if you clone latest typeshed and make vscode use that (I overwrote the languageSever.x.y.z/Typeshed folder) then you no longer get completions/info tips.

microsoft/PTVS#4877

@jakebailey
Copy link
Member

jakebailey commented Nov 27, 2018

I'm willing to bet it's because of this: python/typeshed@25ac4d6

exc_info()'s return value was changed from a plain tuple into _OptExcInfo, which is:

_OptExcInfo = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]]

Whether or not it's due to the Optional or due to the fact that it changed from an inline type to one that's assigned, I don't know offhand.

@MikhailArkhipov MikhailArkhipov self-assigned this Dec 19, 2018
@jakebailey
Copy link
Member

jakebailey commented Feb 8, 2019

This was almost fixed as of #546 (e1 and e2 have types), but TracebackType doesn't seem to get resolved even though it's been imported in the stub.

@jakebailey
Copy link
Member

Looked at this more closely; sys.pyi imports types (which would be types.pyi) and types.pyi imports sys (to do those simple if statements).

@jakebailey
Copy link
Member

This looks to be fixed, though the tooltips could use some work.

image

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

No branches or pull requests

3 participants