diff --git a/CHANGELOG.md b/CHANGELOG.md index 21c97e0..9efcd90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # DeliciousBytes Library Change Log +## [1.1.1] - 2025-09-09 +### Changed +- The `Bytes.encode()` and the `Bytes.decode()` methods now treat the `order` keyword +argument as optional, with a default value of `None`, although if it is specified, it +must reference a `ByteOrder` enumeration option. + ## [1.1.0] - 2025-09-09 ### Added - The `Bytes.encode()` and the `Bytes.decode()` methods now support reversing the order diff --git a/source/deliciousbytes/__init__.py b/source/deliciousbytes/__init__.py index aa18626..8eef461 100644 --- a/source/deliciousbytes/__init__.py +++ b/source/deliciousbytes/__init__.py @@ -999,7 +999,7 @@ def __new__(cls, value: bytes | bytearray | Int, length: int = None): def encode( self, - order: ByteOrder = ByteOrder.MSB, + order: ByteOrder = None, reverse: bool = False, length: int = None, raises: bool = True, @@ -1017,9 +1017,11 @@ def encode( "Ensure the 'encode' method is being called on a class instance!" ) - if not isinstance(order, ByteOrder): + if order is None: + pass + elif not isinstance(order, ByteOrder): raise TypeError( - "The 'order' argument must have a ByteOrder enumeration value!" + "The 'order' argument, if specified, must have a ByteOrder enumeration value!" ) if not isinstance(reverse, bool): @@ -1064,7 +1066,7 @@ def encode( def decode( cls, value: bytes | bytearray, - order: ByteOrder = ByteOrder.MSB, + order: ByteOrder = None, reverse: bool = False, ) -> Bytes: """The decode method decodes the provided value into a Bytes type; the byte @@ -1079,9 +1081,11 @@ def decode( "The 'value' argument must have a bytes or bytearray value!" ) - if not isinstance(order, ByteOrder): + if order is None: + pass + elif not isinstance(order, ByteOrder): raise TypeError( - "The 'order' argument must have a ByteOrder enumeration value!" + "The 'order' argument, if specified, must have a ByteOrder enumeration value!" ) if not isinstance(reverse, bool): diff --git a/source/deliciousbytes/version.txt b/source/deliciousbytes/version.txt index 1cc5f65..8cfbc90 100644 --- a/source/deliciousbytes/version.txt +++ b/source/deliciousbytes/version.txt @@ -1 +1 @@ -1.1.0 \ No newline at end of file +1.1.1 \ No newline at end of file