qapi: type 'info' as Optional[QAPISourceInfo]
commit4a82e468e76f67901a7fcaeaf2d31904664658cc
authorJohn Snow <jsnow@redhat.com>
Mon, 1 Feb 2021 19:37:46 +0000 (1 14:37 -0500)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 8 Feb 2021 13:15:58 +0000 (8 14:15 +0100)
treede646e460d76b17d5919147e5f28c14864354edf
parentcc0747f6b709c197b077cd313f37617fc80c3be1
qapi: type 'info' as Optional[QAPISourceInfo]

For everything typed so far, type this parameter as
Optional[QAPISourceInfo].

In the most generic case, QAPISchemaEntity's info field may be None to
represent types that come from built-in definitions. Although some
Entity types may not currently have any built-in definitions, it is not
easily possible to constrain the type except on an ad-hoc basis using
assertions.

It's easier and simpler, then, to just say it's always an Optional type.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-Id: <20210201193747.2169670-16-jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
scripts/qapi/commands.py
scripts/qapi/events.py
scripts/qapi/gen.py
scripts/qapi/types.py
scripts/qapi/visit.py