def foo(self, sub, **kwargs):
accounts = kwargs.get('accounts')
start = kwargs.get('start', 0)
end = kwargs.get('end', 0)
return json.dumps(
sub(accounts, start, end),
)
Can you explain, what this ‘sub’ is and what it does?
It’s just a parameter of the function, and the code expects it to be a callable.
Python functions, methods and objects with a
__call__method are all callable and could be used to supplyfoowith an argumentsub.There is not much else we can say about this without a lot more context.