diff options
author | John Snow <jsnow@redhat.com> | 2024-03-15 16:22:53 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2024-04-24 10:03:54 +0200 |
commit | 583f4d6fdd96f0f25f39018a9b160654e3f9aa01 (patch) | |
tree | 28ee6e6e21c46ff2efa4228ccab20d0e6d0646e8 /scripts/qapi/parser.py | |
parent | 9beda22dcbd93150c822d651322f62e45eab25bb (diff) |
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/parser.py')
0 files changed, 0 insertions, 0 deletions