Thanks, Florent. That's what I suspected, given my nascent understanding of how categories work.
So an irrevocable decision needs to be made at construction time, it would seem. Rob On Mar 20, 10:55 am, Florent Hivert <florent.hiv...@univ-rouen.fr> wrote: > Hi Rob, > > On Sat, Mar 20, 2010 at 10:38:15AM -0700, Rob Beezer wrote: > > I wonder if the category infrastructure would support a pervasive > > command like > > > R=IntegerModRing(7) > > R.promote(Fields(), with_check=True) > > R.category() > > Category of fields > > > with the construction doing no extra work, and the promote method > > having defaults and exceptions consistent with John and Nick's > > "explicit is better" philosophy? > > > I had though about is_field doing the upgrade, but I think these sort > > of side-effects are confusing. > > I already discussed about such thing with Nicolas, but as far as I remember > this could be a hard thing to do. Indeed, doing this you not only need to > upgrade the class of R but also of any of its elements in the > memory. Otherwise, older elements won't get new methods which are provided by > the Field() category (eg: division)... I don't think you can achieve > something robust with coercion... > > The only solution I can think about (we is even much more hazardeous), is not > only to accept classes which are bynamically created in python, but also to > have classes which are dynamically *modified*. You have to change the mro() of > a class. I'm not sure that we really want it... > > Nicolas: can you confirm this ? > > Cheers, > > Florent -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org To unsubscribe from this group, send email to sage-devel+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.