<?xml version="1.0" ?><html>
<head>
<title></title>
</head>
<body>
<div align="left"><font face="Arial"><span style="font-size:10pt">On 9 May 2005 at 8:33, Joachim Saul wrote:</span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial" color="#7f0000"><span style="font-size:10pt">> * George Sakkis [2005-05-08 21:00]:</span></font></div>
<div align="left"><font face="Arial" color="#7f0000"><span style="font-size:10pt">> > cdef class MyVector(ArrayType):</span></font></div>
<div align="left"><font face="Arial" color="#7f0000"><span style="font-size:10pt">> >     pass</span></font></div>
<div align="left"><font face="Arial" color="#7f0000"><span style="font-size:10pt">> ></span></font></div>
<div align="left"><font face="Arial" color="#7f0000"><span style="font-size:10pt">> > # seg fauls</span></font></div>
<div align="left"><font face="Arial" color="#7f0000"><span style="font-size:10pt">> > v = Vector((1,2))</span></font></div>
<div align="left"><font face="Arial" color="#7f0000"><span style="font-size:10pt">> ></span></font></div>
<div align="left"><font face="Arial" color="#7f0000"><span style="font-size:10pt">> > Can anyone show the simplest working subclass of PyArrayObject ?</span></font></div>
<div align="left"><font face="Arial" color="#7f0000"><span style="font-size:10pt">> </span></font></div>
<div align="left"><font face="Arial" color="#7f0000"><span style="font-size:10pt">> To the best of my knowledge you can't subclass Numeric arrays in</span></font></div>
<div align="left"><font face="Arial" color="#7f0000"><span style="font-size:10pt">> Python and as Greg said, if not in Python you can't do so in Pyrex</span></font></div>
<div align="left"><font face="Arial" color="#7f0000"><span style="font-size:10pt">> either. This has been a subject of intense discussion amongst the</span></font></div>
<div align="left"><font face="Arial" color="#7f0000"><span style="font-size:10pt">> developers and users of Numeric, and apart from some "historical"</span></font></div>
<div align="left"><font face="Arial" color="#7f0000"><span style="font-size:10pt">> reasons there are some good technical reasons *not* to support</span></font></div>
<div align="left"><font face="Arial" color="#7f0000"><span style="font-size:10pt">> subclassing of Numeric arrays.</span></font></div>
<div align="left"><font face="Arial" color="#7f0000"><span style="font-size:10pt">> </span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt">This is just an aside, but a numarray array can be subclassed:</span></font></div>
<div align="left"><br/></div>
<div align="left"><font face="Arial" color="#7f0000"><span style="font-size:10pt">Python 2.3.3 (#51, Jan 27 2004, 16:30:16) [MSC v.1200 32 bit (Intel)] on win32</span></font></div>
<div align="left"><font face="Arial" color="#7f0000"><span style="font-size:10pt">Type "help", "copyright", "credits" or "license" for
more information.</span></font></div>
<div align="left"><font face="Arial" color="#7f0000"><span style="font-size:10pt">>>> import numarray</span></font></div>
<div align="left"><font face="Arial" color="#7f0000"><span style="font-size:10pt">>>> class MyArray(numarray.ArrayType): pass</span></font></div>
<div align="left"><font face="Arial" color="#7f0000"><span style="font-size:10pt">...</span></font></div>
<div align="left"><font face="Arial" color="#7f0000"><span style="font-size:10pt">>>></span></font></div>
<div align="left"><br/>
</div>
<div align="left"><font face="Arial"><span style="font-size:10pt">Lenard Lindstrom</span></font></div>
<div align="left"><font face="Arial"><span style="font-size:10pt"><len-l@telus.net></span></font></div>
<div align="left"></div>
</body>
</html>