On Sat, Apr 18, 2015 at 12:10:47PM -0700, 'Martin R' via sage-combinat-devel wrote: > Sorry, I should have made myself clearer: I do not understand the > design decision behind the way map_coefficients works. > Shouldn't it rather check whether the function actually produces > something in the coefficient ring?
That's the usual speed vs safety vs flexibility. We definitely want to have a fast map_coefficients that does no check, for those cases where we know that f is an endofunction as specified by the documentation. In some cases the user can find it handy to abuse the system a bit (like Mike is doing), just for output. In all other cases it would be preferable to have systematic checks. Supporting both speed vs safety boils down to adding an option `check=True`, and if possible going trough the Sage code and setting `check=False` wherever we know we are on the safe side. It's an easy change. Volunteers welcome! For supporting cleanly Mike's needs for flexibility, we really would need to change the base ring. It would be nice to have some idiom like: sage: f.map_coefficients(factor, codomain=SR) or sage: f.change_base_ring(SR).map_coefficients(factor) This one is a bit trickier. Cheers, Nicolas -- Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net> http://Nicolas.Thiery.name/ -- 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.