Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

to_standard modifies the original permutation #11425

Closed
kcrisman opened this issue Jun 3, 2011 · 6 comments
Closed

to_standard modifies the original permutation #11425

kcrisman opened this issue Jun 3, 2011 · 6 comments

Comments

@kcrisman
Copy link
Member

kcrisman commented Jun 3, 2011

See this sage-devel thread for several nasty things that happen because combinat methods mess with the lists involved.

sage: from sage.combinat.permutation import to_standard as pts 
sage: a = [1,2,4] 
sage: pts(a) 
[1, 2, 3] 
sage: a 
[5, 5, 5] 
sage: pts([1,1,3]) 
[1, 2, 3] 

Volker Braun also points out

sage: Permutation([3,2])  # invalid one-line notation 
[3, 2] 
sage: _.cycle_string() 
<boom>

CC: @nthiery @hivert

Component: combinatorics

Author: Travis Scrimshaw

Reviewer: Mike Hansen

Merged: sage-5.3.rc0

Issue created by migration from https://trac.sagemath.org/ticket/11425

@tscrim
Copy link
Collaborator

tscrim commented Aug 17, 2012

@tscrim
Copy link
Collaborator

tscrim commented Aug 17, 2012

Author: Travis Scrimshaw

@tscrim
Copy link
Collaborator

tscrim commented Aug 17, 2012

comment:1

Now it makes a copy of the list and modifies that copy.

The second issue should be handled by #8392 since an invalid permutation is passed in.

@mwhansen
Copy link
Contributor

comment:2

Looks good to me.

@mwhansen
Copy link
Contributor

Reviewer: Mike Hansen

@jdemeyer
Copy link

Merged: sage-5.3.rc0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants