mirror of https://github.com/pulumi/pulumi.git
fbe675aeba
This commit strengthens the type of the `@pulumi.getter` decorator so that tools like Pyright infer the type of the decorated function correctly. Prior to this, decorated properties could be inferred as having the type `Any`. This is particularly troublesome when using methods such as `apply`: ```python x = random.RandomString("x", ...) y = x.result.apply(lambda value: f"y-{value}") ``` Here, `x.result` having the type `Any` means that `value` will end up being `Unknown`, providing no useful type information inside the lambda. With this commit, `result` will correctly be inferred as having the type `Output[str]`, and thus `value` will be typed as `str`. Fixes #12557. |
||
---|---|---|
.. | ||
20240324--sdkgen-dotnet-go--fixes-sdk-generation-when-referencing-shared-types-in-config-variables.yaml | ||
20240326--sdk-python--adds-typechecker-runtime-option-to-the-python-language-host.yaml | ||
20240327--docs--implement-java-constructor-syntax-examples.yaml | ||
20240329--sdk-nodejs--update-builtin-module-list-for-function-serialization.yaml | ||
20240402--sdk-nodejs--set-package-json-engines-to-node-18.yaml | ||
20240403--auto-go--avoid-flakyness-when-reading-the-event-log-from-pulumi-commands.yaml | ||
20240403--cli--support-always-fully-qualifying-stack-names-in-cli-output.yaml | ||
20240404--auto--tolerate-missing-stack-and-bookkeeping-files-in-programtest.yaml | ||
20240405--sdk-python--improve-types-of-getters-in-python-sdk.yaml |