Rainer Deyke wrote: > In other words, whether a function is a generator or not is determined at > run-time. The following would work, right? > > def f(x): > if x == 5: > yield 5 # Look ma, I'm a generator. > return > else: > return x # Or maybe not. No and no. The above code would raise a syntax error when compiled. Neil