diff options
author | John Snow <jsnow@redhat.com> | 2021-02-15 21:18:00 -0500 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2021-02-18 19:45:17 +0100 |
commit | 4f7f97a7b3d3321f02f854829f37637d6e144a57 (patch) | |
tree | 60837d0b184cf9cc333608c891ebcb6d46a1819b /trace | |
parent | 9db27346133b5b83699af49d290662d346683259 (diff) |
qapi/introspect.py: create a typed 'Annotated' data strutcure
Presently, we use a tuple to attach a dict containing annotations
(comments and compile-time conditionals) to a tree node. This is
undesirable because dicts are difficult to strongly type; promoting it
to a real class allows us to name the values and types of the
annotations we are expecting.
In terms of typing, the Annotated<T> type serves as a generic container
where the annotated node's type is preserved, allowing for greater
specificity than we'd be able to provide without a generic.
Signed-off-by: John Snow <jsnow@redhat.com>
Message-Id: <20210216021809.134886-11-jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'trace')
0 files changed, 0 insertions, 0 deletions