>
> Suppose that our object X has a basis consisting of four 2x2 matrices, 
> in some abstract sense.  Then your 
>
>    X.list() 
>
> might very well return a tuple of four *mutable* 2x2 matrices.   Then 
> this X.tuple() is still very much mutable, and the original problem 
> has not been solved.    I guess that's my point. 
>

I am inclined to agree with Volker. Returning a tuple from X.list() would 
be one basic device to help not accidentally change the list of the 
elements of X, though it is not a bulletproof one.

Making list(X) and X.list() return different things definitely 
> violates the "principle of least surprise". 


Is that list(X) returns a list while X.list() returns a tuple so 
surprising? The former can be seen as a "conversion" from X to a list , 
like list((1,2,3)), while the latter is a command to list elements of X, as 
Volker said.

I made this mistake once 
> before with matrices, in which X.list() returns a list of all the 
> entries of the matrix, whereas list(X) returned the rows.    This is 
> totally my fault, definitely wrong, and its' in Sage right now. 
>

The list of the rows of X is the closest thing to X. So we can understand 
the current behavior as the "conversion" of a matrix.

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to