Skip to content

The addition of varying fields #869

@ApxMK

Description

@ApxMK

Description

I have thought of a new feature which could really benefit developers. So it would be good to have a msgspec class which has a "varying" field type. Meaning that if two instances have the same field and type but differ by the amount/repetition of that field, then they should be considered an instance of the msgspec class and of the same type. This would be useful in modelling situation when you have instance 1:
field 1 : type y
field2[0] : type x
field2[1] : type x
field2[2] : type x

And instance 2:
field 1 : type y
field2[0] : type x
field2[1] : type x
field2[2] : type x
field2[3] : type x
field2[4] : type x

And where the msgspec fields could be something like:
field 1 : type y
field2[varying] : type x

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