Skip to content

drop type from enums for actual enums #442

Closed

Description

@jkowalleck

adding a type to an enum is a lazy and error-prone way to inherit the needed functionality from primitives.

  • instead of "equal"(==) a "identical"(is) to be used.
  • if mathematical comparrisson ala != > >= == <= < was required, then it should be implemented by hand with the correct operations and NotImplemented errors
  • if hasing was needed, then it should be done based on the case's name.

from

class SchemaVersion(str, Enum):
  foo: str = '1' 
  ...

to

class SchemaVersion(Enum):
  foo: str = '1' 
  ...

possibly a breaking change

does not apply to the schema-internal enums,
does only apply to:

  • schema.Format -- unique auto
  • schema.SchemaVersion -- tuple of int with compare

Activity

  1. added this to the 5.0.0 milestone on Sep 19, 2023
  2. changed the title [-]drop type from enums [/-] [+]drop type from enums for actual enums[/+] on Sep 21, 2023
  3. added 3 commits that reference this issue on Sep 21, 2023
    6a6598e
    a8c4e61
    06b5eb0
  4. linked a pull request that will close this issuefeat!: v5.0.0 #440on Sep 21, 2023
  5. added a commit that references this issue on Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions