Generators vs. Functions?


in <dr86uc$8kt$1@xxxxxxxxxxxxxx>, Magnus Lycka <lycka@xxxxxxxxx> posts the
result of a short test that seems to indicate that resuming a generator takes
more time than calling a function.

If this is actually also true in the general case, and not due to eventual
non-representativeness of the test mentioned above, is it simply due to a
less-than-optimum implementation of generators in the current Pyython
interpreter and thus likely to change in the future or is this a matter of
principle and will consequently remain like this forever?



Wolfgang Keller