Hi Bruce, > For most combinatorial objects, the main things you want to implement are: > > - An __init__ for the parent that calls Parent.__init__(self, > category=cat), with cat either Sets(), EnumeratedSets(), > EnumeratedSets().Finite(), EnumeratedSets().Infinite(), etc. > - An __init__ for the element that takes the parent as the first argument > that calls Element.__init__(self, parent) or whatever the reasonable base > class is. > - Set the parent "Element" class level *attribute* to the corresponding > element class. > - All elements with data D of a parent P you construct should be though > either P(D) or the more direct P.element_class(P, D). > - An __iter__ for the parent if you know how to iterate over objects. > > The default _element_constructor_ is sufficient to handle the rest unless > you need some extra preprocessing that cannot be done in the element > class's __init__. However, see Simon's very good response for more specific > details. >
Also, have a look at the implementation of k-tableaux in combinat/k_tableau.py. That should give an idea how to implement other kinds of tableaux. Best, Anne -- 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 https://groups.google.com/group/sage-combinat-devel. For more options, visit https://groups.google.com/d/optout.