Class initialization

Costin Gament costin.gament at gmail.com
Sun Aug 8 15:32:19 CEST 2010


Hi there.
I'm kind of a beginner with Python (and programming in general). My
problem is with initializing a class. Let's say I've defined it like
this:

class foo:
   a = 0
   b = 0

and later I'm trying to initialize two different classes like this:
c1 = foo()
c2 = foo()

The problem I have is that c1 and c2 tend to point to the same
instance, like a weird c-like pointer. Please tell me, what am I doing
wrong?

Thank you,



More information about the Python-list mailing list