Helloooooooooooooo everybody !!! > since we want Permutation() to only accept input from 1 to n. In particular
Well, I do not want Permutations to be defined on 1...n only. First, because I ideally would like them to be defined on 0...(n-1), and then because of course I would like them to be defined on any Sage object. I want Permutation methods to return valid results, though. And the only practical way we have to do this (unless somebody with real knowledge of all methods modifies them so that it works on arbitrary permutations) is to make sure that the input matches what the methods assume. What I think is the most important, though, is to have some Cython Permutation class, which would be a fast backend to your GeneralisedPermutation, or just Python Permutations.. And those would naturally be 0...n-1 s they would be integer arrays : i.e. the most natural implementation of a Permutation. At Python-level we could detect on-the-fly whether the permutations are integer ones (0...n-1, i.e. if we can store them using the backend only) or generalized ones. I have a stupid question: why can't one just use lists? > One should not overdesign. What are the real > reasons for GeneralizedPermutation to come? > E.g. to have a special class to just handle a pair of lists of > equal length is a big an overdesign to me. > And if you need the first list to be ordered, use a pair (set,list) > I totally agree with that. Many graph functions are meant to return "sets of vertices", but returning a list of them makes sense. The only exception to that, I believe, are the feedback_vertex_set methods which will have to be fixed eventually :-) Nathann -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To view this discussion on the web visit https://groups.google.com/d/msg/sage-combinat-devel/-/JWJ_JfvAjr0J. 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.