Skip to content

PropertyDeclaration

Declares a Python property with optional getter, setter, and deleter methods.

import { PropertyDeclaration } from "@alloy-js/python";
<PropertyDeclaration
abstract
decorators={Children[]}
doc={Children}
name="string"
refkey={Refkey}
type={Children}
>
{children}
</PropertyDeclaration>
abstractoptional boolean
childrenoptional Children
decoratorsoptional Children[]Decorators rendered above the intrinsic @property line, in source order (decorators[0] is topmost / applied last). Use for decorators that wrap the resulting property, e.g. Pydantic’s @computed_field.
docoptional Children
namestring
refkeyoptional Refkey
typeoptional Children