Skip to content

Should we integrate with annotated-types? #177

Description

@jcrist

Follow up from #176 and #154.

We currently support adding constraints to types by annotating them with msgspec.Meta. annotated-types provides it's own annotations describing the same constraints - we could potentially integrate with them in 2 ways:

  • Consume annotated-types annotations. This would let msgspec work with annotated types annotations as well as our own built-in Meta annotations.
  • Produce annotated-types annotations. This would make Meta.__iter__ produce the equivalent annotated-types annotations, letting it work with other tools that consume such types.

I'm not convinced there's a real use case for either of these integrations, and would want to hear from multiple real users before expending any effort supporting this. See #176 (comment) for a longer write up of my thoughts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions