> or possibly: > > def make_switch(*args): > """Return a generator that loops through args.""" > if not args: > raise RuntimeError("Missing parameter: args.") > def switch(): > while True: > for a in args: > yield a > return switch Holy cow, that's much nicer! Thanks, // mark -