diff options
author | John Snow | 2021-02-16 03:18:00 +0100 |
---|---|---|
committer | Markus Armbruster | 2021-02-18 19:45:17 +0100 |
commit | 4f7f97a7b3d3321f02f854829f37637d6e144a57 (patch) | |
tree | 60837d0b184cf9cc333608c891ebcb6d46a1819b /scripts/qapi/parser.py | |
parent | qapi/introspect.py: Introduce preliminary tree typing (diff) | |
download | qemu-4f7f97a7b3d3321f02f854829f37637d6e144a57.tar.gz qemu-4f7f97a7b3d3321f02f854829f37637d6e144a57.tar.xz qemu-4f7f97a7b3d3321f02f854829f37637d6e144a57.zip |
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 'scripts/qapi/parser.py')
0 files changed, 0 insertions, 0 deletions