[sage-devel] Re: inheriting from a matrix class, adding attributes

2013-06-09 Thread Travis Scrimshaw
Hey, I wouldn't wrap if you can/want to use it as another type matrix (in particular, being able to use its superclass' methods without having to unwrap it, worry about coercion, write functions which simply pass to the wrapped element, etc.). IMO wrapping is good when you want to interact wi

[sage-devel] Re: inheriting from a matrix class, adding attributes

2013-06-07 Thread Jason Grout
On 6/6/13 11:00 PM, David Roe wrote: You can't inherit from both dense and sparse, but you can probably create a PoolingMatrix class that doesn't inherit from either then a PoolingMatrix_dense and PoolingMatrix_sparse that inherit from both the relevant matrix class and your generic PoolingMatrix

[sage-devel] Re: inheriting from a matrix class, adding attributes

2013-06-05 Thread Rob
Travis, thanks for the response (still wrapping my head around it). On Wednesday, June 5, 2013 7:34:35 AM UTC-7, Travis Scrimshaw wrote: > > Hey Rob, > Here's a patch where I made CartanMatrix inherit from regular > matrices: http://trac.sagemath.org/sage_trac/ticket/14137. Although it is >

[sage-devel] Re: inheriting from a matrix class, adding attributes

2013-06-05 Thread Travis Scrimshaw
I should also say, you probably do not need the metaclass since you don't need to do extra processing of the inputs (actually I probably don't need it either...) -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and

[sage-devel] Re: inheriting from a matrix class, adding attributes

2013-06-05 Thread Travis Scrimshaw
Hey Rob, Here's a patch where I made CartanMatrix inherit from regular matrices: http://trac.sagemath.org/sage_trac/ticket/14137. Although it is slightly bad as there is not a proper parent, but here's the short version: __metaclass__ = ClasscallMetaclass @staticmethod def __cla