This is perhaps related, but I found that using one-line permutation 
notation is rather dangerous. It would be nice to have some more input 
checking here, perhaps with an optional check=True argument to switch it off 
if you have to:

sage: Permutation([3,2])  # invalid one-line notation
[3, 2]
sage: _.cycle_string()
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)

/home/vbraun/<ipython console> in <module>()

/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/sage/combinat/permutation.pyc
 
in cycle_string(self, singletons)
    369             '(1,2)(3)'
    370         """
--> 371         cycles = self.to_cycles(singletons=singletons)
    372         if cycles == []:
    373             return "()"

/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/sage/combinat/permutation.pyc
 
in to_cycles(self, singletons)
    557             while next != cycleFirst:
    558                 cycle.append( next )
--> 559                 l[next - 1], next  = False, l[next - 1]
    560             #Add the cycle to the list of cycles
    561             if singletons or len(cycle) > 1:

IndexError: list index out of range

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to