Use keys instead of iterkeys for py3