A generator, duck typing, and a branchless conditional walk into a bar.
Size matters at codegolf.stackexchange.com.