Yo !

> sage: Permutation([1,2,3]) 
> > [1, 2, 3] 
> > sage: Permutation((1,2,3)) 
> > [2, 3, 1] 
>
> this actually makes perfect sense for someone with some 
> group theory background. 
> (array notation vs cyclic notation) 
>

I will repeat it for as long as people will ignore it, but NO it does not 
make sense. You define a permutation with a collection of disjoint cycles, 
not with one cycle alone. And if some input are list of lists (cycle 
notation) and some others just list you do not need to differentiate 
between tuple/list. This is also your only protection against undefined 
domains.

Secondly, from the point of view of the coder (or from the point of view of 
a guy who does not know that he uses Permutations, because he calls a 
function which calls a function, ...., which calls Permutation) this is 
dangerous too. I had this very problem when playing on permutation group: 
in general you do not expect the meaning of function( tuple(thing) ) to be 
different from the meaning ot function( list(thing) ). And you can't really 
say that one has to "know a bit about permutations" when you do not even 
call Permutation yourself though the function you use does it.

Quite recently we had this too in #16261.

sage: H = AdditiveAbelianGroup([0,2])
sage: H((2,0))
(0, 0)
sage: H(vector((2,0)))
(2, 0)

Everybody seemed to agree that the following was a very bad idea: Is there 
a reason why it is a bad idea in AbelianGroup with tuples/vectors and a 
good idea for Permutations with tuples/lists ?

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.

Reply via email to