The current implementation is rather fragile and hard to generalize at times. In particular:
The segments attribute is a list of Record or None objects. Perhaps empty records could be represented with an empty-represented Record object instead. One cannot tell the segment length from the None object.
For variable-layout records, the layout record is read into the first segment. Maybe there should be a way to abstract away the layout record so that applications do not need to know about fixed vs variable layout records.
The current implementation is rather fragile and hard to generalize at times. In particular:
segments
attribute is a list ofRecord
orNone
objects. Perhaps empty records could be represented with an empty-represented Record object instead. One cannot tell the segment length from the None object.