object creation

BiraRai birarai at gmail.com
Fri Nov 14 18:10:09 EST 2008


On Nov 14, 5:44 pm, George Sakkis <george.sak... at gmail.com> wrote:
> On Nov 14, 5:16 pm, BiraRai <bira... at gmail.com> wrote:
>
> > 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.  I want to instantiate a new x object for
> > each iteration of the FOR loop
>
> What is box()? Pasting its definition would help.
>
> George

class box:
   a = int()
   b = int()

  def createSomething(self,x):





More information about the Python-list mailing list