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

Remove ordereddict in favour of python dict #977

Conversation

pseudo-rnd-thoughts
Copy link
Member

@pseudo-rnd-thoughts pseudo-rnd-thoughts commented Mar 22, 2024

Description

OrderedDict were used for legacy reasons when dict where no insertion ordered (which OrderedDict are).
However, in Python 3.6, python dict were updated for speed and in the process added insertion ordering.

Therefore, this PR updates the return type of Dict space to be a python dict.
However, we probably cannot remove the self.spaces = sorted(spaces) as this could break old code that might flatten the dictionary or use next, making this bug very difficult to discover

Original issue: #940

@pseudo-rnd-thoughts pseudo-rnd-thoughts merged commit 15d1790 into Farama-Foundation:main Mar 22, 2024
11 checks passed
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.

None yet

1 participant