pulumi/tests/testdata/codegen/single-or-none-pp/python/single-or-none.py

10 lines
229 B
Python

import pulumi
def single_or_none(elements):
if len(elements) != 1:
raise Exception("single_or_none expected input list to have a single element")
return elements[0]
pulumi.export("result", single_or_none([1]))