Changelog#
More entries will be added in the future.
[2.6.3] - Patch#
Fixed#
caterpillar#
Fix various stub files and decorator annotations
[2.6.2] - Patch#
Fixed#
caterpillar.field._base#
Fix 1-length sized array fields
caterpillar#
Add compatibility with at least Python 3.10 by using
typing_extensions
[2.6.1] - Hot-Fix#
Fixed#
caterpillar.fields._base#
Fix switch functionality within the Field class for ContextPath objects
caterpillar.fields.common#
fix
%operator for theAsLengthRefclass.
[2.6.0] - Minor Release#
Added#
caterpillar.fields._base#
Add support for non-context lambda switch fields
caterpillar.fields.common#
Add compatibility support for CAPI atoms in
Int,UIntandPyStructFormattedFieldAdd new
AsLengthRefclass
caterpillar.options#
Add custom
Flag.__eq__implementation to support equality check withc_Optionobjects
caterpillar.abc#
Add new typing-only _OptionLike protocol
Add missing _SupportsType protocol to the stubs file
Add new method get to the _ContextLike protocol
caterpillar.context#
Add new option
O_CONTEXT_FACTORYthat controls the global context type. Value must be a method or another type implementing the_ContextLikeprotocolAdd new global context path:
root(exported asGin shortcuts)
caterpillar.shortcuts#
Add new shortcuts
Cforctx,PforparentandGfor therootcontext asContextPathobjects
CAPI#
New index assignment system when generating CAPI code. A running number is now applied instead of a hard coded index.
Add complete Context implementation in C (
c_Context) that conforms to the_ContextLikeprotocol.Add
Atomfor C-based struct-like classes. This class was previously known ascatomAdd native support for __bits__ in
AtomAdd special class
LengthInfofor packing or unpacking multiple objectsNew builtin atoms (CAPI):
Repeated,ConditionalandSwitchAdd new shared objects and exception types to the native implementation (
Cp_ContextFactory,Cp_ArrayFactory,CpExc_StopandCp_DefaultOption)
Changed#
caterpillar.fields._base#
Rework
Fieldimplementation to reduce overhead when packing and unpacking elementsUse pre-computed states instead of calculating everything on-the-fly. States will be adjusted when setting new values (automatically updated through
@propertyattributes)
Fixed#
caterpillar.fields.common#
Fix issue in Prefixed that occurred when the internal struct packs a sequence of elements
Removed#
CAPI#
Remove old CAPI and completely revamp the CAPI concept to make it compatible to the Python equivalent.
[2.5.1] - Hot-Fix Release#
Fixed#
caterpillar.model#
An issue when packing or unpacking a bitfield with unnamed fields AND
S_DISCARD_UNNAMEDenabled
[2.5.0] - Minor Release#
This version introduces massive changes due to the addition of stub files. Most of the type hints in the Python file are ported into several stub files. Additionally, the bitfield concept was completely renewed to be more flexible and dynamic.
Added#
caterpillar.abc#
_SupportsBitsprotocol_ContainsBitsprotocol_SupportsTypeprotocol
caterpillar.shortcuts#
New shortcuts:
typeof(),to_struct(),hasstruct(),getstruct()andsizeof()
caterpillar.context#
New context attribute: _root can be set to point to the root context instance. Internally, instead of a for-loop that iterates through parent context instances, a simple
self.get(...)call is made.
Removed#
caterpillar.abc#
_Actionprotocol and create two separate Protocols that form:_ActionLike = _SupportsActionUnpack | _SupportsActionPack
__type__requirement from_StructLikeBreaking:
_EnumLike,_ContextPathStr
caterpillar.model#
Unused
getformatfunction
caterpillar.fields.common#
Unused
__fmt__function inTransformer
Changed#
caterpillar.abc#
Rename
_Switchprotocol to_SwitchLikeMove the following attributes and methods into caterpillar.shared: rename
STRUCT_FIELDtoATTR_STRUCT,hasstruct(),getstruct()andtypeof()
caterpillar.byteorder#
Move
BYTEORDER_FIELDto caterpillar.shared asATTR_BYTEORDER
caterpillar.model#
sizeof()now checks if the provided object implements the_SupportsSizeprotocolNew
Bitfieldconcept with enhanced syntax
Documentation#
Update reference and library docs as well as section numbering
Fixed#
caterpillar.model#
when parsing union objects with an unbound stream object
field options defined in Sequences and Structs were not populated when creating fields.