Skip to content

Add order and eq config options for Structs - #122

Merged
jcrist merged 3 commits into
mainfrom
order-struct
Jun 18, 2022
Merged

Add order and eq config options for Structs#122
jcrist merged 3 commits into
mainfrom
order-struct

Conversation

@jcrist

@jcrist jcrist commented Jun 18, 2022

Copy link
Copy Markdown
Member

Adds two new configuration options for Struct classes:

  • order: if True, instances of this struct will be orderable. Default is False.
  • eq: if True, instances of this struct will be comparable. Default is True.

The first adds new support for generating __lt__, __le__, __gt__, and __ge__ methods, the latter adds support for disabling the existing __eq__ method. This is mainly to expand parity with dataclasses.

@jcrist
jcrist merged commit cd58e2c into main Jun 18, 2022
@jcrist
jcrist deleted the order-struct branch June 18, 2022 13:29
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.

1 participant