On Friday, June 3, 2016, Volker Braun <vbraun.n...@gmail.com> wrote: > 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. > >
I too would be fine with deprecating the list method, since one already has list(...), and adding another method such as elements() that returns a tuple (or whatever) makes sense. > -- > 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 > <javascript:_e(%7B%7D,'cvml','sage-devel%2bunsubscr...@googlegroups.com');> > . > To post to this group, send email to sage-devel@googlegroups.com > <javascript:_e(%7B%7D,'cvml','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. > -- Sent from my massive iPhone 6 plus. -- 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.