python3 iterator interface fixes