object creation

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Fri Nov 14 17:40:17 EST 2008


BiraRai a écrit :
> for record in roll:
>     x = box()
>     x.createSomething(record)
>     do something ....
> 
> 
> Can anyone tell me why python keeps return the original object x that
> was created in the FOR loop.  

Where is the "return" statement ?

> I want to instantiate a new x object for
> each iteration of the FOR loop

That's already what you do.




More information about the Python-list mailing list