Thanks to all who have responded. My template now looks like: class Foo(Element):
def __init__(self,a): self.data = a def __repr__(self): return str(self.data) class Foos(Parent, UniqueRepresentation): # This class represents the set of all Foo's def __contains__(self,f): return isinstance(f,Foo) Element = Foo FreeM = CombinatorialFreeModule(QQ,Foo) One problem is that s = Foo(1) and then trying to inspect using s.Tab gives AttributeError: 'NoneType' object has no attribute 'category' and FreeM(s) gives TypeError: No conversion defined from None to Free module generated by <class '__main__.Foo'> over Rational Field However FreeM.monomial(s) does work -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-combinat-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-combinat-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-combinat-devel. For more options, visit https://groups.google.com/d/optout.