On Fri, Mar 07, 2014 at 09:48:11AM -0800, Nils Bruin wrote: > Shouldn't that be "Does Sage know that R is a finite set *by > construction*?" If the "is_finite" result gets cached in the categories > we'd violate immutability of parents, i.e., > > sage: R in FiniteSets() > False > sage: R.is_finite() > True > sage: R in FiniteSets() > True > > would be bad. I know there are some cases where we've swallowed this > badness in favour of some gains in efficiency elsewhere. I guess one could > argue it's the category that gets mutated, not R, but I'm not sure that's > entirely fair.
Changing on the fly the category of a parent to a subcategory with more structure (e.g. more operations) would certainly be bad w.r.t. immutability; it's really creating a different parent. In the above case however, it's about changing the category to a full subcategory, which means that no structure is added: you just have learned more information. In principle, I believe this would be a feature. GAP does it a lot for example. There are some technicalities though (upgrading the class of the parent *and* of all its elements) which means that I am not sure how to do this robustly yet. So yes, for now, I would be fine with your formulation. Cheers, Nicolas PS: I changed the subject of this e-mail, since we are deviating topic -- Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net> http://Nicolas.Thiery.name/ -- 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.