Hi, sorry, guys; I woke up to 20 replies and I probably need to catch up first, but as I need to catch a plane, let me throw in my 2 cents now.
Can we make Composition.sum() a classmethod rather than a staticmethod? I don't understand why it is not currently a classmethod. This isn't sane: sage: Composition([1,2]).sum([Composition([3]),Composition([4])]) [3, 4] This is not to say that Sage's overriding of sum() (the global function, not the Composition method) is good craftsmanship. This piece of code in sage/misc/functional.py: if hasattr(expression, 'sum'): return expression.sum(*args, **kwds) is basically a heuristic. There should be no heuristics involved in a sum method. What again is the difference between Python's add() and Python's sum() ? Or is add() a Sage alias for sum() ? And how exactly does overriding __add__ sabotage coercion? By not letting the return value be coerced into the right class? If so, this might be intended. At least on partitions, there are many operations which explicitly should not cast their return value into the same subclass their input values came from; I imagine the same making sense on compositions (the concatenation of two compositions-of-length-less-or-equal-3 needs not be a such). Best regards, Darij -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-combinat-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-combinat-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-combinat-devel. For more options, visit https://groups.google.com/d/optout.