On Tue, Apr 20, 2010 at 7:21 AM, Robert Somerville <span dir="ltr"><<a href="mailto:rsomerville@sjgeophysics.com">rsomerville@sjgeophysics.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


class ctest():<br>
   x = int<br>
   y = [1,2,3] <br></blockquote><div><br>Variables defined directly under the class are known as "static variables" in many other languages. Here in Python it's called a class variable, but they're still the same concept.<br>

<br>What you want is "instance variables", which are not shared by the class instances, but different depending on each instance instead. That said,<br><br>class ctest():<br>    def __init__(self):<br>        self.x = int<br>

        self.y = [1, 2, 3]<br><br>is probably what you're after.<br><br>Cheers,<br>Xav <br></div></div>