Re: [Numpy-discussion] subclassing ndarray subtleties??

2012-05-22 Thread Nathaniel Smith
On Mon, May 21, 2012 at 6:47 PM, Tom Aldcroft aldcr...@head.cfa.harvard.edu wrote: Over on the scipy-user mailing list there was a question about subclassing ndarray and I was interested to see two responses that seemed to imply that subclassing should be avoided. From Dag and Nathaniel,

Re: [Numpy-discussion] subclassing ndarray subtleties??

2012-05-22 Thread Tom Aldcroft
On Tue, May 22, 2012 at 4:07 PM, Dan Goodman dg.gm...@thesamovar.net wrote: On 22/05/2012 18:20, Nathaniel Smith wrote: I don't know of anything that the docs are lacking in particular. It's just that subclassing in general is basically a special form of monkey-patching: you have this

Re: [Numpy-discussion] subclassing ndarray subtleties??

2012-05-22 Thread Chris Barker
On Tue, May 22, 2012 at 1:07 PM, Dan Goodman dg.gm...@thesamovar.net wrote: I think it would be useful to have an example of a completely 'correctly' subclassed ndarray that handles all of these issues that people could use as a template when they want to subclass ndarray. I think this is by

[Numpy-discussion] subclassing ndarray subtleties??

2012-05-21 Thread Tom Aldcroft
Over on the scipy-user mailing list there was a question about subclassing ndarray and I was interested to see two responses that seemed to imply that subclassing should be avoided. From Dag and Nathaniel, respectively: Subclassing ndarray is a very tricky business -- I did it once and regretted