Open
Description
Describe the bug
Static properties in the generated Python code are not correctly interpreted by the type checking system. They're recognized as class methods, and require casting.
Consider the following example snippet:
ec2.Vpc(self, "vpc", sugnet_configuration=ec2.Vpc.DEFAULT_SUBNETS)
Expected Behavior
pyright does not report any issues
Current Behavior
Type checker interprets the type of the property as a callable method
error: Argument of type "(cls: Vpc) -> List[SubnetConfiguration]" cannot be assigned to parameter "subnet_configuration" of type "Sequence[SubnetConfiguration] | None" in function "__init__"
Type "(cls: Vpc) -> List[SubnetConfiguration]" cannot be assigned to type "Sequence[SubnetConfiguration] | None"
"object" is incompatible with "Sequence[SubnetConfiguration]"
Type cannot be assigned to type "None"
Reproduction Steps
Use any static property and enable type checking.
Possible Solution
No response
Additional Information/Context
No response
SDK version used
1.61.0
Environment details (OS name and version, etc.)
Linux