qapi: Replace List[str] with Sequence[str] for ifcond
commit2184bca7b17559107032ba4fd8fc6f65345276ed
authorJohn Snow <jsnow@redhat.com>
Tue, 16 Feb 2021 02:17:51 +0000 (15 21:17 -0500)
committerMarkus Armbruster <armbru@redhat.com>
Thu, 18 Feb 2021 16:10:29 +0000 (18 17:10 +0100)
tree8ce7e157281f96233f1fa60adc95a50207ee8286
parent91416a4254015e1e3f602f2b241b9ddb7879c10b
qapi: Replace List[str] with Sequence[str] for ifcond

It does happen to be a list (as of now), but we can describe it in more
general terms with no loss in accuracy to allow tuples and other
constructs.

In the future, we can write "ifcond: Sequence[str] = ()" as a default
parameter, which we could not do safely with a Mutable type like a List.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-Id: <20210216021809.134886-2-jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Commit message tweaked]
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