Hi! I have a Python class which inherits from ParentWithGens, and I want to overload the method __temporarily_change_names that is inherited from CategoryObject. But how can this be done?
First I tried the "obvious" way, along these lines: sage: from sage.structure.parent_gens import ParentWithGens sage: class C (ParentWithGens): ....: def __temporarily_change_names(self,names,latexnames): ....: print 'boo' ....: sage: P = C('a') sage: P.__temporarily_change_names(1,1) (None, None) So, apparently the method inherited from CategoryObject is still in use, the direct attempt to overload did fail. Then, I remembered Python's name mangling and tried to rename the method into _CategoryObject__temporarily_change_names, but it did not work either. Is there some way to get this thing overloaded? Cheers, Simon -- 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