tpcp.CloneFactory#

class tpcp.CloneFactory(default_value: tpcp._base.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

get_value()

Clone the default value for each instance.

__init__(default_value: tpcp._base.T)[source]#
get_value() tpcp._base.T[source]#

Clone the default value for each instance.