Am 2014-08-23 um 12:13 schrieb Vincent Delecroix: > Hi, > > You must bypass the element_class. > > 1) Convert your base classes to categorized classes using something along > > Parent P: > def ___init__(self): > self.element_class_A = self.__make_element_class__(MyElementA) > self.element_class_B = self.__make_element_class__(MyElementB) > > 2) then you can use these classes (and will benefit from the category stuff) > > Parent P: > def _element_constructor_(self, data): > if some_condition(data): > return self.element_class_A(data) > else: > return self.element_class_B(data) > > 3) In order to make the tests pass (ie TestSuite(P).run()) you must > set P.element to either element_class_A or element_class_B.
Thanks. I'll give it a thought and a try. Daniel -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.