partition is returning generators in Python 3