A generator, duck typing, and a branchless conditional walk into a bar.
Feel like exercising your brain? Have a go at one of the problems I have for you.