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. |
Beta Was this translation helpful? Give feedback.
-
|
That makes sense, thanks for the clarification! |
Beta Was this translation helpful? Give feedback.
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?
Beta Was this translation helpful? Give feedback.
All reactions