python get generator length