Say I have a function
def my_meta_function (a, b, c):
pass
I would like define an array of functions myfunctions = [f1, f2, f3, ... f100]
, where the argument c
is fixed to a different value for each such function, e.g. c = [1,2,3, .. 100]
, and the functions only take the arguments a
and b
. In practice, the arguments I am considering are more complictated, but I am trying to understand how to do this in the language.
- Does this type of meta-programming have a name?
- Are decorators appropriate for this? If not, why?