[sdk/python] Improve ResourceOptions.merge type (#4484)

* [sdk/python] Improve `ResoruceOptions.merge` type

The implementation correctly handles `None` inputs, so the type should allow these as well.

* Add CHANGELOG
This commit is contained in:
Luke Hoban 2020-04-24 17:45:11 -07:00 committed by GitHub
parent 0f424e73ce
commit cfa57914a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -16,10 +16,12 @@ CHANGELOG
- Ensure Go accessor methods correctly support nested fields of optional outputs
[#4456](https://github.com/pulumi/pulumi/pull/4456)
- Improve `ResourceOptions.merge` type in Python SDK
[#4484](https://github.com/pulumi/pulumi/pull/4484)
- Ensure generated Python module names are keyword-safe.
[#4473](https://github.com/pulumi/pulumi/pull/4473)
## 2.0.0 (2020-04-16)
- CLI behavior change. Commands in non-interactive mode (i.e. when `pulumi` has its output piped to

View file

@ -444,7 +444,7 @@ class ResourceOptions:
# pylint: disable=method-hidden
@staticmethod
def merge(opts1: 'ResourceOptions', opts2: 'ResourceOptions') -> 'ResourceOptions':
def merge(opts1: Optional['ResourceOptions'], opts2: Optional['ResourceOptions']) -> 'ResourceOptions':
"""
merge produces a new ResourceOptions object with the respective attributes of the `opts1`
instance in it with the attributes of `opts2` merged over them.