Unfortunately that didn't seem to work. I got the following error after the change:<div><br><div><div>>>> a = Foo()</div><div>Traceback (most recent call last):</div><div> File "<stdin>", line 1, in <module></div>
<div> File "foo.pyx", line 7, in foo.Foo.__cinit__ (foo.c:388)</div><div> self.count += 1</div><div>AttributeError: 'foo.Foo' object attribute 'count' is read-only</div><div><br></div><div><br>
</div><div>To clarify, I want the value of the count variable to remain the same between all instances. So if I create 3 Foo objects, each object should show 3 as the value in the count variable.</div><div><br></div><br><div class="gmail_quote">
2009/6/2 Cristi Constantin <span dir="ltr"><<a href="mailto:darkgl0w@yahoo.com">darkgl0w@yahoo.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font:inherit"><br>Good day.<br>You should try <span style="font-weight:bold">self.count += 1</span> instead of Foo.count += 1.<br></td></tr>
</tbody></table></blockquote></div><br></div></div>