On Thu, Jun 2, 2016 at 1:39 PM, Volker Braun <vbraun.n...@gmail.com> wrote:
> On Thursday, June 2, 2016 at 5:34:49 PM UTC+2, William wrote:
>>
>>  (1) No matter your grammar argument about deficiencies in the
>> technical language, it's a fact that the majority of English speakers
>> is going to consider this confusing.
>
>
> The majority of English speakers will be perfectly unaware of the difference
> between Python list and tuple anyways.

You're probably right -- I actually meant the majority of English
speaking Python users, not all English speakers.


>>  (2) Tuples aren't really immutable either, in that if their entries
>> are mutable, then they are overall mutable.
>
>
> And even if the entries aren't mutable you can always attach a debugger and
> write into memory. Your point being?

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.

In this case the obvious solution is to explicitly make the basis
matrices returned by X.list() immutable.   Making X.list() return a
tuple doesn't solve this problem at all.

Making list(X) and X.list() return different things definitely
violates the "principle of least surprise".  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.  I
would like to strongly urge you to not make the same mistake again
(OK, my mistake with matrices is definitely worse than this list/tuple
thing, by far).

~$ sage-develop
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 7.3.beta2, Release Date: 2016-05-28               │
│ Type "notebook()" for the browser-based notebook interface.        │
│ Type "help()" for help.                                            │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable.     ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
A = matrix(2,[1..4])
A.list()
sage: A = matrix(2,[1..4])
sage: A.list()
[1, 2, 3, 4]
sage: list(A)
[(1, 2), (3, 4)]
sage:




-- 
William (http://wstein.org)

-- 
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