jcrist · GitHub

@jcrist

Previously tagged unions only supported `str` tag values. We now also
support `int` tag values, with a few caveats:
- A single `Union` of `Struct` types cannot mix both `int` and `str` tag
types.
- Integer `tag` values currently only support values that fit in an
int64 (-2**63 <= tag <= 2**63 - 1). This restriction has also been added
to `IntEnum` and integer `Literal` types (previously these supported up
to a `uint64`). This restriction makes the implementation easier, but
can be removed if needed in the future. For now a `NotImplementedError`
is raised if the user attempts to use out-of-range integer values,
pointing them to raise an issue on GitHub if they need the feature.

Read the original on github.com ↗