[sage-support] Re: Is it possible to add methods to an existing class at runtime ?

2016-10-08 Thread Andrew
Sorry, you're right. I hadn't tried this with cython classes. Andrew On Sunday, 9 October 2016 12:43:10 UTC+11, Emmanuel Charpentier wrote: > > Sorry, that doesn't work with Sage's compiled classes : > > @add_method_to_class(sage.symbolic.expression.Expression) > def demoivre(self): > r""" >

[sage-support] Re: Is it possible to add methods to an existing class at runtime ?

2016-10-08 Thread Emmanuel Charpentier
Sorry, that doesn't work with Sage's compiled classes : @add_method_to_class(sage.symbolic.expression.Expression) def demoivre(self): r""" Wrapper for Maxima's demoivre() function """ return(maxima.demoivre(self).sage()) @add_method_to_class(sage.symbolic.expression.Expression)

[sage-support] Re: Is it possible to add methods to an existing class at runtime ?

2016-10-08 Thread Andrew
On Sunday, 9 October 2016 04:25:39 UTC+11, Emmanuel Charpentier wrote: > > I wonder if it is possible to patch a new method in an existing class. For > example, it might be handy to give SR methods for doing what can be > obtained by Maxima's function demoivre and exponentialize. Those methods