Skip to content

Commit

Permalink
[refactor] use class attributes for fixed recordType and recordLength
Browse files Browse the repository at this point in the history
These are moved from the __init__() to class attributes.
This pattern makes it less likely for users to accidentally initialise the class with the
wrong recordType or recordLength, where these values are known beforehand.

Class attributes are accessible by instances of the class, so the serialize() and parse()
methods are unaffected.

### Further changes

- added type annotations to attributes, marking them as being an enum, int, or float,
  along with their size in bits
- fixed init types for some attributes
- removed some unnecessary comments
- added table UID in comments for some enums
  • Loading branch information
ngjunsiang committed Mar 8, 2024
1 parent cb8697b commit fa6b689
Showing 1 changed file with 209 additions and 142 deletions.
Loading

0 comments on commit fa6b689

Please sign in to comment.