Releases: lojack5/structured
Releases · lojack5/structured
3.1.0 Release
A new version is available:
- Feature:
typing.Selfcan be used as a serializable type-hint, ifSelfis aStructuredderived 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:
arraycan handle 0-length arrays of simple serializable types now (it could always handle complex types, simple types not supporting this was a bug). - Bugfix:
SerializeAsnow works properly when using non-defaultByteOrder.
3.0.0 Release
New update with new features:
- tuples
- unions
- replaced
FormattedwithSerializeAs - Full support for Python 3.11, unofficial support for Python 3.12
Plus lots of background code cleanup, and some slight performance improvements.
Deprecated features removed:
- using
serializedto configure type-hints. All additional configuration is viatyping.Annotated
Install via source, or from pip:
pip install structured-classes
2.0.2 release
Wrapping up all the recent improvments on main.
Biggest new features include:
- Complex data types for packing/unpacking: variable length bytes, automatically decoded strings (
unicodetype), and arrays of formatted orStructuredtypes (arraytype). - Generics in
Structuredclasses.