Make iterators python 3 and 2 compatible.