Dear all,
I am manipulating an IndexedBase object, and I would like to modify its 
behavior when differentiated.

I thought to do something like this:
class custom(sy.IndexedBase):
    def __init__(self, *args, **kwargs):
        sy.IndexedBase.__init__(self, *args, **kwargs)
        
    def diff(self, *args):
        # Do some stuff
        pass

However, when I initialize the object:
b = custom("b")

It gives the error:
 object.__init__() takes no arguments

However, it works if I do:
b = sy.IndexedBase("b")


I have two questions:
1) How can I create an object derivated from IndexedBase?
2) Is my way of doing correct to redefine the behaviour of the derivative? 
(It must work if I derivate a whole expression that contains the object)

Thanks for your attention,
Bests,
Lorenzo

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/e18894ce-7bc2-4f18-b428-78dfb59d6981%40googlegroups.com.

Reply via email to