On Thu, Feb 16, 2012 at 11:54:56PM -0800, Anne Schilling wrote: > Thank you so much! So that I understand for the future: __init__ always needs > to take parent as an input for the element class?
Indeed. > But it does not need to take all inputs that would be needed for a > class call? More precisely, class call may encode the inputs in a different form; in your case, the parent contains the information about the poset. > Why did the parent method in this case also need a > __classcall_private__? Is it because of the optional variables that > are passed in? In part. But more importantly because LinearExtensionsOfPoset accepts a list as input, and lists are not hashable. So class call needs to transform it into a tuple before passing it down to UniqueRepresentation. See the documentation of UniqueRepresentation for details. > Currently sage seems to randomly choose a linear extension for a > given poset. However, it is much nicer if the specified poset P > corresponds to the identity linear extension. Ok. Then don't we want instead to be able to specify a linear extension to the Poset constructor? Say: sage: P = Poset(...., linear_extension = [1,2,3,4,5,6,7]) Which could be used as well to change the default linear extension: sage: Q = Poset(P, linear_extension = [1,3,2,5,4,6,7]) Also we might want to have Poset be clever enough to test if the list of vertices provided by the user is a linear extension, and if it is to use it as default linear extension rather than looking for some random one? > I do not find it so unnatural to have P.linear_extension() and > P.linear_extensions(). If P.linear_extensions() becomes the list of > LinearExtensionsOfPoset, then what should linear_extension become? I > as a user would prefer to assign the identity to P as a linear > extension. I am a bit confused now. I guess part of the question is whether we want to have a double use for P.linear_extension: sage: P.linear_extension() returns the default linear extension of P (as a list or as a linear extension?) sage: P.linear_extension([1,5,3]) returns the linear extension [1,5,3] Cheers, Nicolas -- Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net> http://Nicolas.Thiery.name/ -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To post to this group, send email to sage-combinat-devel@googlegroups.com. To unsubscribe from this group, send email to sage-combinat-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en.