From cc7a6576288d4ae7db7b2fad6b4491a6707bfc2d Mon Sep 17 00:00:00 2001 From: Joe Duffy Date: Thu, 4 Apr 2019 16:55:01 -0700 Subject: [PATCH] Make the Python SDK's Config.name argument optional (#2624) This makes the Python SDK's Config constructor name argument optional, similar to what we do in the Node.js SDK. If not supplied, the current project name is used as the default. --- CHANGELOG.md | 2 ++ sdk/python/lib/pulumi/config.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18331e84b..d268202cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ### Improvements - Correctly handle the case where we would fail to detect an archive type if the filename included a dot in it. (fixes [pulumi/pulumi#2589](https://github.com/pulumi/pulumi/issues/2589)) +- Make `Config`'s constructor's `name` argument optional in Python, for consistency with our Node.js SDK. If it isn't + supplied, the current project name is used as the default. ## 0.17.4 (Released March 26, 2019) diff --git a/sdk/python/lib/pulumi/config.py b/sdk/python/lib/pulumi/config.py index 23bf2f7c3..c8846e6b3 100644 --- a/sdk/python/lib/pulumi/config.py +++ b/sdk/python/lib/pulumi/config.py @@ -36,10 +36,10 @@ class Config: The configuration bag's logical name that uniquely identifies it. The default is the name of the current project. """ - def __init__(self, name: str) -> None: + def __init__(self, name: Optional[str] = None) -> None: """ - :param str name: The configuration bag's logical name that uniquely identifies it. The default is the name of - the current project. + :param str name: The configuration bag's logical name that uniquely identifies it. If not provided, the name + of the current project is used. """ if not name: name = get_project()