pproperty¶
- pconfigs.pproperty(_func=None, *, deps=None, manual_deps=False)[source]¶
Decorator that defines a computed property in a pconfig class.
See also
For examples, see Properties.
Unlike regular properties (which should be avoided),
pproperty-based properties have the following characteristics:They are evaluated at class construction time, which enables
python -m pconfigs.test.Their dependencies are inferred and cycles are detected at class definition time.
The user can provide input values to the property, which can be revised by the property.
- Usage:
@ppropertyor@pproperty()
- Parameters:
manual_deps (bool, optional) – When
False, property dependencies are inferred from the property’s source code. WhenTrue, only the dependencies specified indepsare used.deps (Sequence[str], optional) – Explicit list of attribute names that the property depends on. This is optional and should rarely be used.
- Raises:
SyntaxError – If the property function cannot be parsed.