user_defined
Contains the base classes to support .params and .attr containers for user-defined parameters and attributes.
AttrContainerMixin(*args, **kwargs)
Container(preprocess=None)
A container for user-defined attributes or parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
preprocess
|
Callable[str, Any], optional A function to preprocess user-defined values before adding them to the container. |
None
|
Examples:
>>> params = Container()
>>> params.a = 1
>>> params.b = 2
>>> params.a
1
>>> params.b
2
>>> for k, v in params:
... print(k, v)
a 1
b 2