Jerry Hill a écrit :
On Fri, Nov 14, 2008 at 6:10 PM, BiraRai <[EMAIL PROTECTED]> wrote:
class box:
a = int()
b = int()
def createSomething(self,x):
At a guess, x = box() does create a new instance of your box class,
but since you've declared a and b to be class variables instead of
instance variables, it doesn't look that way to you.
Try adding the line:
print id(x)
after you call x = box(), and you should see that.
Then add
def __init__(self):
a = 0
b = 0
to your box class to make a and b instance variables.
You meant:
def __init__(self):
self.a = 0
self.b = 0
--
http://mail.python.org/mailman/listinfo/python-list