I like doing:
super_func = { 'add': sum, 'foo': lambda a:a*a+a }I wouldn't delete it like this... because you want to use it in the future
del super_func["foo"]So what I would do is maybe create a super function object!
class SuperFunction: def __init__(self, function, use=True): self.function = function self.in_use = use def run(self) if self.in_use: self.function() else: print("Failed to run function because today you can't do it") import inspect print(inspect.getsource(self.function)) #then create a dict. super_func = { 'add': SuperFunction(sum) 'foo': SuperFunction(lambda a:a*a+a, False) } super_func["foo"].run() # I think we can add a method better than .run() which does a function overload on the the call parenthesis for an object. I just don't know what i should google to find this.