Replies: 2 comments
|
The distinction between "declaration" and "definition" is clearer in languages like C++ where declarations are found in ".h" files and definitions are found in ".cpp" files. The closest analog to a header file in Python is a stub file. In cases where both a stub file and a corresponding ".py" file is present, pyright treats the stub file as the "declaration" and the corresponding symbol in the ".py" file as the definition. If one or the other is missing, then "declaration" and "definition" collapse into a single concept. |
0 replies
|
That makes sense, thanks for the clarification! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I noticed the pyright lsp server seems to offer both the "declaration" and the "definition" queries for a symbol under the cursor (but not "implementation"). Are they the same and provided for completeness? Does python make a meaningful difference between the two?
All reactions