I think from Iran's POV, Hamas is great for causing Israel (and the Evil Imperialistic US, Decadent West, and rest of the world) problems galore. They are a useful proxy at the moment, but I have no doubt that if the strategic or political dynamic changes, they will be unceremoniously jettisoned.
Bookmarks