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

PR: Preserve order when saving/loading files from a project. #4880

Merged
merged 5 commits into from
Aug 13, 2017

Conversation

rlaverde
Copy link
Member

@rlaverde rlaverde commented Aug 2, 2017

Fixes: #4839

When saving loading files from project configuration the order wasn't preserved, set doesn't preserve the order (except in python3.6).

Searching I found that using collections.OrderedDict is maybe the best way to delete duplicates and preserve order regardless the python interpreter implementation.

@rlaverde rlaverde added this to the v3.2.2 milestone Aug 2, 2017
@rlaverde rlaverde self-assigned this Aug 2, 2017
@rlaverde rlaverde requested review from ccordoba12 and goanpeca August 2, 2017 15:43
@andfoy
Copy link
Member

andfoy commented Aug 2, 2017

I think you can use frozenset also: https://docs.python.org/2/library/stdtypes.html#frozenset

@rlaverde
Copy link
Member Author

rlaverde commented Aug 2, 2017

I think you can use frozenset

But frozenset doesn't guaranties order neither

Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rlaverde and sorry for the delay!

@ccordoba12 ccordoba12 merged commit 6b464b3 into spyder-ide:3.x Aug 13, 2017
ccordoba12 added a commit that referenced this pull request Aug 13, 2017
@rlaverde rlaverde deleted the preserve-order-files branch August 14, 2017 01:33
@ccordoba12 ccordoba12 mentioned this pull request Aug 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants