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

Please, don't jump to stub files! #5044

Closed
cangyin opened this issue Oct 29, 2023 · 3 comments
Closed

Please, don't jump to stub files! #5044

cangyin opened this issue Oct 29, 2023 · 3 comments
Assignees
Labels
needs repro Issue has not been reproduced yet

Comments

@cangyin
Copy link

cangyin commented Oct 29, 2023

For python 3.8.10, with pylance v2023.1.10

#!/usr/bin/python3

import sys

from unicodedata import category

Ctrl+Click on unicodedata jumps to the damn stub file, that's frustrating and drives me crazy.

Issues I read:

But none of them actually solves the problem.

What in the end is the meaning for creating such stub files? Python is not C/C++, it does not need a header file!

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Oct 29, 2023
@erictraut
Copy link
Contributor

Where would you expect it to take you in this case? There is no unicodedata.py file. This module is implemented in C and compiled as part of the Python interpreter. That means there is no source code on your system that can be displayed. Pylance is falling back to the type stubs in this case because they at least provide you with the interface definitions for this module.

@cangyin
Copy link
Author

cangyin commented Oct 29, 2023

Well, that sounds completely reasonable to me. But I suggest adding a heading comment for such stub files, telling for why the stub file is chosen to shown up.

So there will be less persons be confused by pylance not carrying them to the actual .py files.

@cangyin cangyin closed this as completed Oct 29, 2023
@cangyin
Copy link
Author

cangyin commented Oct 29, 2023

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

3 participants