-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(rosetta): change how python shows declared types and include mo…
…dule name (#3317) Currently, Python type declarations are rendered as such: ```python # get_book_handler is of type Function # get_book_integration is of type LambdaIntegration get_book_integration = apigateway.LambdaIntegration(get_book_handler, content_handling=apigateway.ContentHandling.CONVERT_TO_TEXT, # convert to base64 credentials_passthrough=True ) ``` This PR adds information on what module the type came from (if possible), and changes the way these type declarations are shown: ```python # get_book_handler: lambda.Function # get_book_integration: apigateway.LambdaIntegration get_book_integration = apigateway.LambdaIntegration(get_book_handler, content_handling=apigateway.ContentHandling.CONVERT_TO_TEXT, # convert to base64 credentials_passthrough=True ) ``` --- By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
- Loading branch information
Showing
5 changed files
with
48 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/jsii-rosetta/test/translations/expressions/array_index.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# array is of type list of string | ||
# array: List[str] | ||
|
||
print(array[3]) |
2 changes: 1 addition & 1 deletion
2
packages/jsii-rosetta/test/translations/statements/declare_var.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# variable is of type Type | ||
# variable: Type |