pulumi/sdk/python/lib
Will Jones fbe675aeba
Type functions decorated by `@pulumi.getter` (#15865)
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.
2024-04-05 15:14:40 +00:00
..
pulumi Type functions decorated by `@pulumi.getter` (#15865) 2024-04-05 15:14:40 +00:00
test automation: only read complete lines before trying to deserialize (#15778) 2024-03-26 14:32:56 +00:00
test_with_mocks [sdk/{nodejs,python}] Fix errors when testing remote components with mocks (#8053) 2021-09-24 06:08:13 -07:00
setup.py Freeze v3.112.0 (#15799) 2024-03-28 00:10:27 +00:00