Hello,

On Wed, Jul 14, 2010 at 11:10 PM, Andrey Novoseltsev <novos...@gmail.com> wrote:
> sage: isinstance(SR,
> sage.rings.principal_ideal_domain.PrincipalIdealDomain)
> False

sage: SR.is_field()
True

> and this creates problems in FreeModule_generic_pid constructor. I am
> working on #9502 and when I tried to switch base call constructor in
> FreeModule_submodule_with_basis_pid to its real base
> FreeModule_generic_pid, I got errors.

> What would be the correct test that will accept SR as a PID?

I think the best thing would be

SR in PrincipalIdealDomains()

but that requires the category to be set to fields in SR.__init__.


--- a/sage/symbolic/ring.pyx
+++ b/sage/symbolic/ring.pyx
@@ -50,7 +50,8 @@
             sage: sage.symbolic.ring.SymbolicRing()
             Symbolic Ring
         """
-        ParentWithBase.__init__(self, self)
+        from sage.categories.all import Fields
+        ParentWithBase.__init__(self, self, category=Fields())
         self._populate_coercion_lists_(convert_method_name='_symbolic_')

     def __reduce__(self):


Since I don't think everything has been categorized, I think you made
need to do an or statement with the old isinstance check.  There
doesn't seem to be too much (if any) fallout from the change based on
my limited testing.

--Mike

-- 
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

Reply via email to