Skip to content

Incorrect Enum items order #2

@norlin

Description

@norlin

Hey,

In Python 3.4, according to docs, the order of the items should be by definition.
But here, the items are explicitly sorted and this is causing the wrong order if the values are not defined in the alphabetic order (e.g. for strings).
For int values it seems will also create issues, if someone define enum values in non ascending order, but I see no reason to do that.
For strings, it's more complicated as enum with string values can be defined in non-alphabetic order as it's not so obvious.

https://github.com/ethanfurman/enum34/blob/c3e05468727500a5e783ac41e87ab70709a5d213/enum/__init__.py#L178C22-L178C22

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions