Oh, sorry, I forgot the bug report : with this branch applied, here is what happens :
sage: GF(5).cartesian_product(GF(5))((5,5)) Nathann On 29 April 2014 15:48, Nathann Cohen <nathann.co...@gmail.com> wrote: > Hello ! > > > > Sorry, I was offline this morning. I just got your message saying you > > had fixed most of the issues in the mean time, but since this might be > > of general interest here is what I had already typed down. > > I solved my other group issues, this one has an easy workaround (wrap > everything 10 times before giving it to the constructor) but it isn't > solved. > > > > Throwing your _element_constructor_ code there should do the job. > > I know, that's what I said I was doing. But this _element_constructor_ > breaks anyway. > > > > Do you have the code on some branch? I guess the issue is some typo, > > like a missing s to CartesianProducts. Similarly, > > CommutativeAdditiveGroups. > > A typo ? But I would get some meaningful error in this case, not this, > would I ? > > > TypeError: Cannot convert tuple to sage.structure.element.Element > > >> Autre question : quand j'ai un objet CartesianProduct, comment je > >> recupere la liste de ses composantes, qui sont normalement des > >> parents ? > > > > Introspection is the tool of choice to recover this kind of > > information. From looking at: > > > > sage: C = cartesian_product([GF(2), GF(2)]) > > sage: C?? > > > > or from the code of > > > > sage: C.one?? > > Nicolas, I can swear that in the mind of somebody who never had anything > to do with categories, there is no link whatsoever between finding those > sets and the function "one()". When you know the answer already, it is very > easy to find it again. When you don't, you spend minuteson things like > this, and sometimes you even give up. > > > In your case it's fine to use the attribute. > > Yeah, I found it. I don't remember how, but I did. There is a branch at > u/ncohen/tmp which implements the _element_constructor_ I needed, plus > order/cardinality. > > The order/cardinality work, but if you can tell why _element_constructor_ > raises an exception and how it should be fixed, perhaps we will be able to > work with products of additive groups in Sage (and other stuff too). > > Have fuuuuuuuuun ! > > Nathann > -- 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/d/optout.