bambam wrote:
> That is, is it defined what Python does for
>     for i in f()
> I'm sure it must be, but I haven't seen it yet. If I have
> a user defined function returning a range, is it defined
> that the range function is called on every loop? If I
> have a function returning a range taking a parameter,
>     for i in f(v)
> is it defined that the variable is evaluated for every loop?

Nope.  Take the tutorial.

     for i in f(v):
         <suite>
is the same as:
     iterator = iter(f(v))
     for i in iterator:
         <suite>

-Scott David Daniels
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to