Pylance not hinting parameters that are passed to parent through **kwargs #4465
Replies: 3 comments
-
I think it would be good enhancement to add to our completion provider. thank you for the suggestion! tagging @luabud |
Beta Was this translation helpful? Give feedback.
-
Moving this issue to discussion as an enhancement request for comments and upvotes. |
Beta Was this translation helpful? Give feedback.
-
This feature would be great. I'm extending classes from AWS CDK to have some sane defaults and I don't know every possible keyword argument that's available to me when using these subclasses. PyCharm seems to do this without a problem. Is there a known workaround for vscode/pycharm? Edit: Jedi seems to do this as well. |
Beta Was this translation helpful? Give feedback.
-
Environment data
Pylance language server 2023.5.51 (pyright 7784093a)
OS: MacOS 13.3.1 (a) (22E772610a)
Python3.11 venv
Also tested the release version of Pylance with same results.
This is a followup to #4449 which was closed. The code I provided then was not quite complete, but the code bellow is.
PyCharm correctly infers the parameters being flowed through to the parent init() (via **kwargs) while Pylance is not.
Changing the code is also not an option for me because the **kwargs pattern below is being used in an external library that I am using in my project and I have no control over it.
Code Snippet
Repro Steps
With the two classes above, parameter hinting while creating an instance of the Child class does not show the parameters defined in the parent.
Expected behaviour
As observed in PyCharm
Actual behavior
Beta Was this translation helpful? Give feedback.
All reactions