On Tue, Sep 22, 2009 at 11:25:12AM -0700, Robert Bradshaw wrote: > On Sep 22, 2009, at 4:49 AM, Nicolas M. Thiery wrote: > > Variant: > > > > sage: R = Zmod(6) > > sage: R.set_category(Fields()) # or maybe better R.add_category > > (Fields()) > > sage: R in Fields() > > True > > sage: assert R in Fields() > > > > This avoids cluttering each sage object with an is_bla method which > > might refer to a completely unrelated category bla. Also, this handles > > automatically the inheritance of category (so that stating that R is > > in Fields imposes that it also is a division ring, ...). > > One issue with that is that, forever after in your sage session, Zmod > (6) will be a field (unless you change it manually back, if you know > that the library function you called changed it...) That's why I > liked the new object method. Alternatively, this might be a good use > for contexts.
Good point. I am not very keen on adding new categories on the fly either. Then, I would vote for R = Zmod(6, category = Fields()), since many parents readily support this features. Cheers, Nicolas -- Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net> http://Nicolas.Thiery.name/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---