[Numpy-discussion] subclassing recarray

Stefan van der Walt stefan at sun.ac.za
Tue Jan 2 02:22:19 CST 2007


Hi Matthew

On Tue, Jan 02, 2007 at 02:30:34AM -0500, Matthew Koichi Grimes wrote:
> Is it hard to subclass recarrays? I'm currently working on a subclass 
> that  doesn't add much; just some methods that sets all the values to 
> zero and other similarly trivial things. It'd be nice to make it work, 
> but if I have to use external functions on a plain recarray instead of 
> this subclass, I won't be found weeping in the corner.

Pierre wrote this useful wiki entry on subclassing:

http://www.scipy.org/Subclasses

It describes exactly what you want to do.

Find attached some example code.

Regards
Stéfan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: subrec.py
Type: text/x-python
Size: 513 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/numpy-discussion/attachments/20070102/61d606ed/attachment.py 


More information about the Numpy-discussion mailing list