To avoid un-necessary list creation and indexing, I would recommend iterating over the values lazily, as such

``
for oo in open_orders.itervalues():
    self.cancel_order(oo.i)
``