Simon,

> class Foo(Bar):
>     def __init__(self, *args):
>         <do something special for Foo>
>       Bar.__init__(self, *args)

Duh. I forgot to explicitly declare Foo as a subclass of Bar.

I have little object-oriented programming experience, having
wasted my misspent youth on innumerable unreadable
one-line Mathematica functions
which map a function onto lists of tuples. However see below.

>> sage.rings.polynomial.multi_polynomial_ring.MPolynomialRing_polydict
>>
>> which seemed like the most friendly class of general-purpose
>> multivariate polynomial ring that I could find.
>
> From my perspective, it is the least friendly class. Very slow, too
> general to be useful.

Well, noone likes slow, but I need general.
I want to make an extremely user-friendly
feature-rich version of the functor Sym from, R-modules to R-algebras,
(where R is a commutative ring), or at least working for
free R-modules-with-basis.

I will use this to autobuild things like the symmetric algebra of the weight
lattice of a Kac-Moody algebra with natural Weyl group action,
with sole input being a generalized Cartan matrix and maybe a few strings
to label elements just so.

If I wanted speed I suppose I could call the PolynomialRing factory
to see what class it returns (as Nicolas suggested) and then
dynamically create my custom class as a subclass of the returned class.

How does one make the subclass declaration dynamically?


-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.

Reply via email to