ooops. So sorry for not reading the doc fully. The answer is to use
cycle_string(singletons= True).

pierre

On Jul 3, 7:38 pm, Pierre <[EMAIL PROTECTED]> wrote:
> hi all,
>
> I'm confused with the cycle notation for permutations (bug ?)
> While the following works:
>
> sage: Permutation( '(1,2)' )
>
> the following yields an error:
>
> sage: Permutation( '(4,5)' )
> IndexError: list assignment index out of range
>
> What's confusing is that if you go:
>
> sage: x= Permutation( (4,5) )
> sage: s= x.cycle_string(); s
> '(4,5)'
>
> I'm trying to build a dictionnary whose keys are permutations; since
> the keys have to be hashable, i'm relying on the cycle_string()
> strings. But the above issue prevents me from recovering a permutation
> from its string !
>
> Is there a way around this ?
>
> thanks
> pierre

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to