Re: [sympy] Re: Ordered terms of a new Expression

2021-03-28 Thread Paul Royik
Thank you! On Friday, March 26, 2021 at 10:54:02 PM UTC+2 asme...@gmail.com wrote: > I didn't test it extensively, but I think it should be enough to > override the sort_key method > > class Colored(Expr): > def sort_key(self, order=None): > return self.args[0].sort_key(order=order) > > Aaron

Re: [sympy] Re: Ordered terms of a new Expression

2021-03-26 Thread Aaron Meurer
I didn't test it extensively, but I think it should be enough to override the sort_key method class Colored(Expr): def sort_key(self, order=None): return self.args[0].sort_key(order=order) Aaron Meurer On Thu, Mar 25, 2021 at 9:43 AM Paul Royik wrote: > > Also, what is the best way

[sympy] Re: Ordered terms of a new Expression

2021-03-25 Thread Paul Royik
Also, what is the best way to set a color? Setting color in args is not a very good idea, as color is a string. On Thursday, March 25, 2021 at 4:06:42 PM UTC+2 Paul Royik wrote: > I want to create a class that makes expression colored. > class Colored(Expr): > pass > > How do I make Colored