8.2.8.11. replicate_value

replicate_value(value, n=2, copy=True)[source]

Replicates n times the input value.

Parameters:
  • n (int) – Number of replications.
  • value (T) – Value to be replicated.
  • copy (bool) – If True the list contains deep-copies of the value.
Returns:

A list with the value replicated n times.

Return type:

list

Example:

>>> from functools import partial
>>> fun = partial(replicate_value, n=5)
>>> fun({'a': 3})
({'a': 3}, {'a': 3}, {'a': 3}, {'a': 3}, {'a': 3})