tpcp.CloneFactory#
- class tpcp.CloneFactory(default_value: T)[source]#
Init factory that creates a clone of the provided default values on instance initialisation.
This can be used to make sure that each instance get their own version own copy of a mutable default of a class init. Under the hood this uses
clone
.Methods
__call__
()Call self as a function.
Clone the default value for each instance.
Examples using tpcp.CloneFactory
#
Dataclass and Attrs support