On Thursday, June 2, 2016 at 5:41:59 PM UTC-4, William wrote: > > 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. >
But that has is totally orthogonal to the question whether list or tuple is the correct array return type for cached data. What returning tuples protects you from is the very easy-to-do mistake elements = GF(5).list() ... 100 lines later .... elements.append(x) # you now broke Sage Now you should *also* only cache tuples of immutable matrices instead of tuples of mutable matrices, but that is another bug to be fixed in your hypothetical example. I'm fine with using elements() or whatever other gem the English language has to offer, but even if we stay with list() then I'd rather have it return tuples than mutable lists. -- 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.