qapi: Simplify QAPISchemaVariants @tag_member
commit285a8f209af7b4992aa91e8bea03a303fb6406ab
authorMarkus Armbruster <armbru@redhat.com>
Sat, 16 Mar 2024 07:46:12 +0000 (16 08:46 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 6 May 2024 10:38:27 +0000 (6 12:38 +0200)
treef29b99830ad42ece245d4d0cf9fbe3eda4994007
parent8152bc7de6d4377d5104078115aa61986b436f44
qapi: Simplify QAPISchemaVariants @tag_member

For union types, the tag member is known only after .check().

We used to code this in a simple way: QAPISchemaVariants attribute
.tag_member was None for union types until .check().

Since this complicated typing, recent commit "qapi/schema: fix typing
for QAPISchemaVariants.tag_member" hid it behind a property.

The previous commit lets us treat .tag_member just like the other
attributes that become known only in .check(): declare, but don't
initialize it in .__init__().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
scripts/qapi/schema.py