Hello everyone,<br><br>Please have alook at the following.<br><br>pyrex@pyrex ~/code $ pyrexc -v<br>Pyrex version <a href="http://0.9.4.1">0.9.4.1</a><br><br>pyrex@pyrex ~/code $ cat test.pyx<br>cdef class Test:<br> cdef int i
<br> cdef int y<br><br> def __init__(self,l,k):<br> self.i=l<br> self.j=k<br> self.x=dict()<br> self.y=list()<br><br> def pp(self):<br> print
self.i<br> print self.j<br> print self.x<br> print self.y<br><br>pyrex@pyrex ~/code $ python<br>Python 2.4.3 (#1, Jul 19 2006, 01:52:32)<br>[GCC 3.4.6 (Gentoo 3.4.6-r2, ssp-3.4.6-1.0
, pie-8.7.9)]<br>Type "help", "copyright", "credits" or "license" for more information.<br>>>> import test<br>>>> t=test.Test(1,2)<br>Traceback (most recent call last):
<br> File "<stdin>", line 1, in ?<br> File "test.pyx", line 7, in test.Test.__init__<br> self.j=k<br>AttributeError: 'test.Test' object has no attribute 'j'<br>>>><br><br><b><span class="nw" id="_user_pyrex@lists.copyleft.no">
</span></b><br>if expected? any alternatives to solve this problem. I have tried "cdef object j", however in that case user will not be able to use the j when user will create an instance of the object Test.<br>
<br>Thanks in advance<br>