Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I'll add an answer in case someone finds something similar. I am new to sage so I suppose there's something silly that I am doing and there are better ways of implementing this.

It turns out that Category_over_base_ring reimplements __contains__ and it tests for the base ring as well. For some reason that I don't know yet my parent's base_ring method does not call D.parent_class.base_ring method but some other. I overloaded it in DParent as follows


class DParent (Parent,UniqueRepresentation):
     ...
     def base_ring(self):
           return self.category().base_ring()

And now J in C returns true.