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

ensure python versions are sorted #86

Closed
wants to merge 1 commit into from
Closed

ensure python versions are sorted #86

wants to merge 1 commit into from

Conversation

0x00b1
Copy link
Contributor

@0x00b1 0x00b1 commented Jun 16, 2021

We may want to add a build step to automatically populate SUPPORTED_PYTHON_VERSIONS.

We will need to provide a custom comparison function if we want to non-uniform version numbers (e.g. 3 and 3.9.5).

@0x00b1
Copy link
Contributor Author

0x00b1 commented Jun 16, 2021

Could someone link the issue? I want to reproduce to ensure the issue is actually fixed. 😆

@codemonkey800
Copy link
Collaborator

codemonkey800 commented Jun 16, 2021

@0x00b1 I think the order is messed up because we're using Object.entries() in the React component. The array SUPPORTED_PYTHON_VERSIONS is technically already sorted, but the order of Object.entries() is not guaranteed:

filters={Object.entries(section.state ?? {}).map(
([key, enabled]: [string, boolean]) => ({
enabled,
label: SECTION_LABELS[key] ?? key,
setEnabled: (nextEnabled: boolean) =>
section.setState?.({ [key]: nextEnabled }),
}),
)}

Copy link
Contributor

@justinelarsen justinelarsen left a comment

Choose a reason for hiding this comment

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

Nice! Thanks for fixing :)

Copy link
Contributor

@justinelarsen justinelarsen left a comment

Choose a reason for hiding this comment

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

@0x00b1 This PR needs some work. See @codemonkey800 's comment #86 (comment)

@neuromusic
Copy link
Collaborator

hey @0x00b1 do you think you can land this or should @codemonkey800 or @kne42 pick it up?

@codemonkey800 codemonkey800 linked an issue Aug 5, 2021 that may be closed by this pull request
@klai95
Copy link
Contributor

klai95 commented Aug 16, 2021

Previous Behavior:
The order of the array returned by Object.entries() does not depend on how the object is defined.
Current Behavior:
The ordering of the properties is the same as that given by looping over the property values of the object manually. I have also tested and verified that the correct behavior is met on multiple browsers.

PR Updating the Docs:
mdn/content#6937

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.

python versions out of order in filters
5 participants