3.2.2.6. Byteorder Extensions#

object.__byteorder__#

The byteorder of a struct can be temporarily configured using the corresponding operator. It is important to note that this attribute is utilized internally and should not be used elsewhere.

>>> struct = BigEndian | struct # Automatically sets __byteorder__
object.__set_byteorder__(self, byteorder)#

In contrast to the attribute __byteorder__, the __set_byteorder__() method is invoked to apply the current byteorder to a struct. The default behavior, as described in FieldMixin, is to return a new Field instance with the byteorder applied. Note the use of another operator here.

>>> field = BigEndian + struct