-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed as not planned
Labels
Description
Feature or enhancement
Proposal:
- Global variable _OTHER_ENDIAN, in the _other_endian function to check for endianness but declared at the module level, leading to potential side effects.
Redundant Type Checks slows down recursion:
if hasattr(typ, _OTHER_ENDIAN):
if isinstance(typ, _array_type):
if issubclass(typ, (Structure, Union)):
Issue: Multiple checks on each call can be inefficient, especially if called frequently.
- In the setattr method of the _swapped_meta class,
for desc in value:
fields.append((name, _other_endian(typ)) + rest)
Issue: Always creates a new list, even when no modifications are needed, which adds overhead.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response