On Tue, Jul 16, 2013 at 2:07 PM, Simon King <simon.k...@uni-jena.de> wrote:
> Hi David, > > On 2013-07-16, David Kohel <drko...@gmail.com> wrote: > > Defining the (left or right) action by * would probably be a > > nightmare with the coercion model, since it is handled as > > a symmetric operator. > > Is this really so? > > There is stuff in sage.structure.coerce, for example methods > R.get_action(S,operator.mul), > which can be overloaded using R._get_action_, where you can also decide on > the > side from which S acts. > > Hence, if you want to let S act on R from the left by multiplication, you > could > simply let S._get_action_(R, operator.mul, True) return an action, and > if you want to let S act on R from the right by multiplication, you > could let S._get_action_(R, operator.mul, False) return an action. > > Agreed: defining actions through * should be no problem. In fact, it will be easier than with ^, since many elements implement __pow__ directly rather than going through the coercion system. David -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/groups/opt_out.