A new version is available:
- Feature:
typing.Self
can be used as a serializable type-hint, ifSelf
is aStructured
derived class. - Feature:
char[math.inf]
andunicode[math.inf]
can be used to consume all remaining bytes in a stream. These must be the final serializable type-hint in a class. - Feature: Conditional serialization: including
Condition(condition_fn, default_value)
in anAnnotated[...]
for a serializable typehint can be used to control whether an attribute is packed/unpacked or not. Useful for defining multiple versions of a data structured with a single class. - Bugfix:
array
can handle 0-length arrays of simple serializable types now (it could always handle complex types, simple types not supporting this was a bug). - Bugfix:
SerializeAs
now works properly when using non-defaultByteOrder
.