Closed ghseeli closed 6 years ago
As a follow-up on this, it is somewhat annoying because the Composition
class has a static method called sum
which concatenates compositions. However, it does not even work the way you would want (because it is a static method)!
sage: c1 = Composition([1,1])
sage: c2 = Composition([2,3])
sage: c1.sum([c2])
[2, 3]
Furthermore, the more intuitive way of doing the same thing already exists and its source code is not even dependent on the sum
method detailed above.
sage: c1+c2
[1, 1, 2, 3]
I do think I should submit a trac ticket about this, because it seems like an odd method that does not behave consistently with everything else. Thoughts?
Well I think the recommended syntax would be Composition.sum(c1, c2)
.
With your syntax and desired output, I would expect the method to be called add
or plus
, not sum.
That being said, I feel like this should be called concat
.
I haven't looked deeply into this, but I trust you have good judgement.
I'm going to focus on the issue in this repo now. I'll make some commits soon.
Feel free to reopen if you have further issues.
Observe the following code
Of course, it is quite annoying that
sum(Composition([1,1]))
does not work (maybe this should be fixed upstream), but for now the error stands.