My stack overflow question about assigning conditions to variables and making generators infinite or limited