docs icon indicating copy to clipboard operation
docs copied to clipboard

Document Python output lifting's use of `__getattr__`

Open lunaris opened this issue 1 year ago • 2 comments

The Pulumi Python SDK lifts output properties by overriding the special __getattr__ method. This is designed to improve the ergonomics of writing Pulumi programs in Python, but technically violates some of the contracts Python expects of this method, particularly in relation to hasattr. This commit warns of this potential gotcha when mentioning output lifting to give users a reference point should they bump into this issue.

Fixes pulumi/pulumi#16743

lunaris avatar Oct 11 '24 10:10 lunaris