Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ByteOrder not respected across Structured boundaries #54

Open
lojack5 opened this issue Oct 3, 2024 · 0 comments
Open

ByteOrder not respected across Structured boundaries #54

lojack5 opened this issue Oct 3, 2024 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@lojack5
Copy link
Owner

lojack5 commented Oct 3, 2024

This one's a difficult one:

class Inner(Structured, byte_order=ByteOrder.LE):
  val: uint32

class Outer(Structured, byte_order=ByteOrder.BE):
  inner: Inner

Here when Outer is unpacked, its inner attribute still unpacks with Little-Endian byte order. We'll have to be careful about how we solve this, since the StructuredSerializer delegates to the Inner class itself, so we can't do a simple Inner.serializer.with_byte_order, otherwise we modify the class in place.

@lojack5 lojack5 added bug Something isn't working enhancement New feature or request labels Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant