summary refs log tree commit diff stats
path: root/scripts/qapi/error.py
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2024-03-15 16:22:53 +0100
committerMarkus Armbruster <armbru@redhat.com>2024-04-24 10:03:54 +0200
commit583f4d6fdd96f0f25f39018a9b160654e3f9aa01 (patch)
tree28ee6e6e21c46ff2efa4228ccab20d0e6d0646e8 /scripts/qapi/error.py
parent9beda22dcbd93150c822d651322f62e45eab25bb (diff)
downloadfocaccia-qemu-583f4d6fdd96f0f25f39018a9b160654e3f9aa01.tar.gz
focaccia-qemu-583f4d6fdd96f0f25f39018a9b160654e3f9aa01.zip
qapi/schema: fix typing for QAPISchemaVariants.tag_member
There are two related changes here:

(1) We need to perform type narrowing for resolving the type of
    tag_member during check(), and

(2) tag_member is a delayed initialization field, but we can hide it
    behind a property that raises an Exception if it's called too
    early. This simplifies the typing in quite a few places and avoids
    needing to assert that the "tag_member is not None" at a dozen
    callsites, which can be confusing and suggest the wrong thing to a
    drive-by contributor.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240315152301.3621858-18-armbru@redhat.com>
Diffstat (limited to 'scripts/qapi/error.py')
0 files changed, 0 insertions, 0 deletions