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
json.dumps, it expects the "vanilla" output, but this way it will get a modified version, which may lead to some errors. As said above - define your own dump function