Hello everybody.

I just created a new patch that adds an input check in the constructor of
Permutation. This, because I have had problems with it, because you can
create an infinite loop with it in two lines, and because it is totally
impossible that -- after looking at the code -- such a thing would not
break anyway.

This has been mentionned there already :
https://groups.google.com/forum/?fromgroups=#!topic/sage-combinat-devel/0i0EbrXvfFc

Mainly : some methods of this class are *WRITTEN* with the assumption that
the elements of a permutation are 1...n. Some other parts of the code
freely feed it with 0...n-1, some others feed it with lists instead of
integers instead of integers.

This patch adds a check_input flag to check that the Permutation is indeed
correct, and this flag is obviously the default. It can be disabled if
needed (for speed), but obviously not to freely feed it with bad input data.

Now, as a lot of code *in Sage* (and doctests) use the code anyway, I set
some check_input = False in the code, and warnings everywhere when needed
to warn people about the results. These warnings have to be removed and a
correct code written. But this patch is totally selfish : I use
Permutations from time to time, and I need to know that my code does not
return wrong results. It's as simple as that. If others do not have such
constraints, I do not mind letting them compute whatever they want. Let
them fix it if they wish. That I have been using such a thing for so long
scares me enough, and quite honestly I am not that eager to deal again with
parts of the code I do not know. Honestly again, I'm sick to think that
this is in Sage. I'm also sick to thing that people have been knowing the
state of this for so long, never doing anything about it.

The ticket is there : http://trac.sagemath.org/sage_trac/ticket/13742

Nathann

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.


Reply via email to