Generator object with yield