-
-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Description
Returning a ZeroPolynomial could be problematic, as you might expect that the following would work:
p = Polynomial(1, 2, 3) * Polynomial(0)
p.a = 5
>>> AttributeError: ...
But it does not, as a ZeroPolynomial is returned and p.a can not be set. Instead, we should define a mutable version of a zero_instance that does not restrict behaviour.
An issue with this would be when we might want to modify a Trinomial / Binomial / other class that enforces restrictions on degree behaviour - these don't really support a zero_instance, as there is no guarantee that they'll become valid class instances - so this change would mostly apply for the Polynomial & Monomial classes.
Metadata
Metadata
Assignees
Labels
No labels