Skip to content

Unknown symbols appear in Pillow import #1465

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

Closed
hudrazine opened this issue Jun 18, 2021 · 6 comments
Closed

Unknown symbols appear in Pillow import #1465

hudrazine opened this issue Jun 18, 2021 · 6 comments
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@hudrazine
Copy link

Describe the bug
It should be a correct import, but when I import the Pillow module, it appears with an unknown symbol.

To Reproduce

from PIL import Image  # ok
from PIL import ImageCms, ImageTk, ImageTransform  # no, there are others...

Expected behavior
I was hoping that Pillow's type hints would be supported.

Screenshots or Code
image

VS Code extension or command-line
Pylance version: 2021.6.2

Additional context
I think the reason for this issue is that the Pillow stubs in typeshed are not included in Pyright and refer to the old Pillow stubs in microsoft/python-type-stubs.

The latest stub for Pillow has been recently added to typeshed. (python/typeshed #5594)

@erictraut
Copy link
Contributor

I'm going to transfer this issue to the pylance-releases repo because it's not related to core type checking functionality but instead relates to type stubs that ship with pylance.

@erictraut erictraut transferred this issue from microsoft/pyright Jun 18, 2021
@judej judej added in backlog needs investigation Could be an issue - needs investigation labels Jun 21, 2021
@github-actions github-actions bot removed the triage label Jun 21, 2021
@jakebailey
Copy link
Member

FWIW, pyright never shipped any stubs from python-type-stubs; those are there and are shipped with Pylance. The ones that were added to typeshed have more of the modules present, but I'd still like to compare (as the stubs I wrote weren't really used to create what was in typeshed, unfortunately).

@jakebailey
Copy link
Member

The next release of pyright and pylance will include the stubs from typeshed, which should include that ImageCms module.

I've sent python/typeshed#5692 and python/typeshed#5706 to upstream the hand-written types I've been maintaining in https://github.com/microsoft/python-type-stubs for Pylance, and they should make it into our next release.

@jakebailey jakebailey added fixed in next version (main) A fix has been implemented and will appear in an upcoming version and removed needs investigation Could be an issue - needs investigation labels Jun 28, 2021
@hudrazine
Copy link
Author

Thanks for the fix.

@jakebailey
Copy link
Member

This would have been fixed in 2021.7.0, but thanks to my brainfart, I forgot to delete the old stubs. It'll be fixed in a 2021.7.1 hotfix momentarily.

@jakebailey
Copy link
Member

This issue has been fixed in version 2021.7.1, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#202171-6-july-2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

4 participants