def get(self, fn, *args): """get returns the matching function from the virtual namespace. return None if it did not fund any matching function. """ func = Function(fn, self) return self.function_map.get(func.key(args=args))
def register(self, fn): """register the function in the virtual namespace and returns an instance of callable Function that wraps the function fn """ func = Function(fn, self) self.function_map[func.key()] = fn return func