provide default argument for monomial_coefficients#39044
provide default argument for monomial_coefficients#39044vbraun merged 5 commits intosagemath:developfrom
Conversation
|
Documentation preview for this PR (built with commit e7abaf6; changes) is ready! 🎉 |
|
Thanks for looking into the issue! The fix looks good to me except for the typo revealed by the tests. |
|
Would you mind tests that |
|
Would also be useful to have test for both cases ( |
It's not clear to me how to do this without a lot of boring work which I'd rather not do. There is not really a benefit, I think. |
|
@fchapoton, the linter is complaining, should I fix these here or separately? Also, what is the correct invocation at home? If I do |
|
the linter must pass. You just need to start with note that pyx files and py file are treated with different rules. In particular E225 is not applied to pyx files |
|
Thinking about it… It might be much better for the user to just deprecate the But then grepping for |
|
No, we definitely should not get rid of |
|
Alternatively, would it make sense to return an immutable (But, please, not in this PR) |
|
Python doesn't have immutable dict. Maybe a dict view would be reasonable but that would be significant change… yes, for this PR we should not consider that issue. |
|
Indeed Python doesn't, and sometimes we do want to modify the internal |
I did add doctests, involving different term orderings, see for example Is this what you had in mind, @mezzarobba ? |
|
Yes, thank you! |
This is a followup to #38767, where we put polynomials into the category of modules with basis. Back then, we missed the fact that
monomial_coefficientsshould take an optional argumentcopy, which we fix here.Fixes #39037