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. |
||
---|---|---|
.. | ||
pending | ||
config.yaml |