Commit c4a239c
Jerry Kindall
chore(init-templates): Python app template imports 'core' as 'cdk' to align sample code across languages (#12970)
For consistency and to make it easier to translate TypeScript examples into Python, import the `aws_cdk.core` module as `cdk`.
There are snippets in the CDK Developer Guide that assume the `core` module is imported as `core`. It is difficult to synchronize changes to the CDK with changes in the Guide, so this PR causes the `core` module to be imported under _both_ names. Once this change is released, the Guide snippets can be updated to use `cdk` rather than `core` to refer to the `core` module. At some point in the future, this template can be updated again to remove the now-redundant `core` import.
This is to support this Guide issue: awsdocs/aws-cdk-guide#268 which intends to make all code snippets in the Guide follow the guidance in the "Working with the CDK in Python" topic.
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*1 parent 430c38b commit c4a239c
File tree
2 files changed
+15
-3
lines changed- packages/aws-cdk/lib/init-templates/v1/app/python
- %name.PythonModule%
2 files changed
+15
-3
lines changedLines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
1 | 7 | | |
2 | 8 | | |
3 | 9 | | |
4 | | - | |
| 10 | + | |
5 | 11 | | |
6 | | - | |
| 12 | + | |
7 | 13 | | |
8 | 14 | | |
9 | 15 | | |
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
3 | 9 | | |
4 | 10 | | |
5 | 11 | | |
6 | 12 | | |
7 | 13 | | |
8 | | - | |
| 14 | + | |
9 | 15 | | |
10 | 16 | | |
11 | 17 | | |
0 commit comments