Searched hist:"4 f7f97a7" (Results 1 – 1 of 1) sorted by relevance
/qemu/scripts/qapi/ |
H A D | introspect.py | 4f7f97a7 Tue Feb 16 02:18:00 GMT 2021 John Snow <jsnow@redhat.com> 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>
|