i have a class definition as follows :
class Trade:
def __init__(self, **kwargs):
# lots of things
I am trying to instantiate one by doing :
trade_tmp = Trade(json.loads(trade_str))
My understanding was that the **kwargs argument would automatically pickup the generated dictionary. Am I incorrect ?
I am getting the whole takes 1 positional argument but 2 were given error which I though should not apply here.
Trade(**json.loads(trade_str))so that it would unpack your kwargs. Right?