Open fraghag opened 2 months ago
Yes i can produce this error when I install pyright
VSCode extension
But I won't have that if I install Pylance.
I guess this might be a Pyright bug?
Pylance uses pyright under the hood. But pylance does not highlight typing errors by default, you have to explicitly tell it to in the settings with:
"python.analysis.typeCheckingMode": "standard",
And also I first checked this with pyright and the guy there says that pyright is doing the right thing and his argument makes sense to me. https://github.com/microsoft/pyright/issues/8984
This is not a Pyright bug - in Python, argument names have to match.
This is a limitation of JSII - tracked here: https://github.com/aws/jsii/issues/4541
Describe the bug
This bug was already reported previously #30431.
Not sure why it was not addressed and the issue closed, so opening a new one. The AWS plugin in VSCode is quite extensive so it seems to be a very encouraged tool to use for AWS development, but this bug makes the coding experience very poor.
Also the
_statement
parameter looks very weirdand if it's called like that instead of
statement
like it is inIPrincipal
for a reason it's seems like an ugly hack.If you think that you are doing the correct thing with regards to python typing then we should start a discussion about it with pyright developers.
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
I'm expecting to not get typing errors when writing the code as it is intended.
Current Behavior
Raises typing error.
Reproduction Steps
See #30431
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.154.1 (build febce9d)
Framework Version
No response
Node.js Version
v20.12.2
OS
Ubuntu 22.04.4 LTS
Language
Python
Language Version
Python 3.12
Other information
No response