Fix pretty printing of polynomials (mostly) #20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Made unicode super- and subscripts more compact
Performance considerations using
print(io, ...)
instead ofjoin
.Code cleanup. Merged the
print_poly
function directly intoBase.show
, asprint_poly
was only being used in theshow
definition (i.e., the function was redundant).The
pretty_var
function was not printing correctly, causing tests to fail—the reason for this is because polynomials would sometimes print in the form2z₂⁴
But sometimes of the form
I'm not sure what caused that, nor for how long the tests were broken, but I just added an extra regex matching in the
pretty_var
function to capture this. The only thing failing now is converting variables ofPolynomial
toSymbol
s correctly:Sorry I haven't been able to fix the
Symbol
problem. It would be good to know what changes causedPolynomial
s to print in 2 different ways.