Am Sonntag 14 Mai 2006 22:29 schrieb Paul Rubin:
> Andrew Robert <[EMAIL PROTECTED]> writes:
> > When I run the script, I get an error that the file object does not have
> >  the attribute getblocks.
>
> Woops, yes, you have to call getblocks(f).  Also, Heiko says you can't
> use "return" to break out of the generator; I thought you could but
> maybe I got confused.

Yeah, you can. You can't return <arg> in a generator (of course, this raises a 
SyntaxError), but you can use return to generate a raise StopIteration. So, 
it wasn't you who was confused... ;-)

--- Heiko.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to