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>
This commit is contained in:
John Snow 2021-02-15 21:17:51 -05:00 committed by Markus Armbruster
parent 91416a4254
commit 2184bca7b1
5 changed files with 21 additions and 20 deletions

View file

@ -17,6 +17,7 @@ from typing import (
Dict,
List,
Optional,
Sequence,
Set,
)
@ -297,7 +298,7 @@ void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds)
def visit_command(self,
name: str,
info: Optional[QAPISourceInfo],
ifcond: List[str],
ifcond: Sequence[str],
features: List[QAPISchemaFeature],
arg_type: Optional[QAPISchemaObjectType],
ret_type: Optional[QAPISchemaType],