You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building input is dict (context) and the output is bytes.
When parsing the input is byte and the output is the construct instance.
The construct implementation does a lot of work in order to parse the data and prepare the construct instance.
The implementation is asymmetric the context lacks much of the construct logic and its notation is different, in this example I show the basic sequence matching between request and response, as I dig more into the parsing feature there are many more examples that I can provide.
I would like to believe that while building the raw bytes out of context and construct classes, construct also builds the hierarchy of instances so that it may be returned to the user as output so that the extra parse will not be required when processing the classes.
I though of something like adding build_with_struct() which returns a tuple with both the raw bytes and the constructed classes, for example:
Hello,
When building input is
dict
(context) and the output isbytes
.When parsing the input is
byte
and the output is the construct instance.The construct implementation does a lot of work in order to parse the data and prepare the construct instance.
The implementation is asymmetric the context lacks much of the construct logic and its notation is different, in this example I show the basic sequence matching between request and response, as I dig more into the parsing feature there are many more examples that I can provide.
The workaround I use is to build/parse the request, this enables symmetric processing, for example:
I would like to believe that while building the raw bytes out of context and construct classes, construct also builds the hierarchy of instances so that it may be returned to the user as output so that the extra parse will not be required when processing the classes.
I though of something like adding
build_with_struct()
which returns a tuple with both the raw bytes and the constructed classes, for example:Thanks,
The text was updated successfully, but these errors were encountered: