You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just noticed the new ordinals module (#13682). There are a few issues with it (sorry I didn't notice this when it was being reviewed).
The printing should be defined in the printers in sympy.printing, not in __str__ (also side note here, methods should not define behavior for subclasses. If you want to define behavior on a subclass, put the method on the subclass. I'm referring to this line).
Why is the class Basic? The operations produce Mul, so either the class should be Expr, or the ordinal operators should use their own classes.
The str printer should print omega, since that is what the variable name is called.
The pretty printer should use ω instead of w.
Doing fancy stuff in __eq__ is generally considered an antipattern in SymPy (objects should compare with == structurally, not mathematically). I haven't dug into what it is actually doing, though, so this may be OK.
I see. Actually, for some reason when I was testing this before multiplying ordinals gave Mul, but now when I test it they only give Ordinal. I'm not sure what happened there.
I just noticed the new ordinals module (#13682). There are a few issues with it (sorry I didn't notice this when it was being reviewed).
__str__
(also side note here, methods should not define behavior for subclasses. If you want to define behavior on a subclass, put the method on the subclass. I'm referring to this line).omega
, since that is what the variable name is called.ω
instead ofw
.__eq__
is generally considered an antipattern in SymPy (objects should compare with==
structurally, not mathematically). I haven't dug into what it is actually doing, though, so this may be OK.CC @ashishkg0022
The text was updated successfully, but these errors were encountered: