zerodha / pykiteconnect

The official Python client library for the Kite Connect trading APIs
MIT License
983 stars 470 forks source link

checking on value instead of key #16

Closed swapniljariwala closed 3 years ago

swapniljariwala commented 7 years ago

Should be checking on params[k] for None values rather than the k.

swapniljariwala commented 7 years ago

sorry this needs to be -

for k in list(param.keys()):
    if params[k] is None:
        del(params[k])

else you'll get an error like this-

--> 265         for k in params:
    266             if params[k] is None:
    267                 del(params[k])

RuntimeError: dictionary changed size during iteration