I think I have here something for issue https://github.com/BlackbirdHQ/atat/issues/180 that doesn't fell like a huge hack.
Still probably a hack but a hope a small one.
It misuses fields attribute from deserialize_struct(), saves it count in the Deserializer.
Then SeqAccess does count how many fields it already parsed, if it hits the branch that no , are present anymore and the count of parsed fields is exactly one less then the expected count of fields to parse it sets a flag in the Deserializer is_trailing_parsing to indicate that parse_str or parse_bytes should now just take everything left and try to parse it.
This does seam to work fine for my use case, but I bet it still has some edge cases where it might not work.
Doesn't seam to break any other tests and I add a test for my use case.
I think I have here something for issue https://github.com/BlackbirdHQ/atat/issues/180 that doesn't fell like a huge hack. Still probably a hack but a hope a small one. It misuses
fields
attribute fromdeserialize_struct()
, saves it count in the Deserializer. Then SeqAccess does count how many fields it already parsed, if it hits the branch that no,
are present anymore and the count of parsed fields is exactly one less then the expected count of fields to parse it sets a flag in the Deserializeris_trailing_parsing
to indicate thatparse_str
orparse_bytes
should now just take everything left and try to parse it. This does seam to work fine for my use case, but I bet it still has some edge cases where it might not work. Doesn't seam to break any other tests and I add a test for my use case.