For example Python has standard module json
. It is not a class.
json.dumps
defined as function with list of default args. I want redefine one of default args - cls
for this function. How I should do it?
json._dumps = json.dumps
def dumps(*kargs, **kwargs):
kwarsg['cls'] = MyClass
return json._dumps(*kargs, **kwargs)
json.dumps = dumps