diff options
author | John Snow | 2021-02-16 03:18:08 +0100 |
---|---|---|
committer | Markus Armbruster | 2021-02-18 19:51:14 +0100 |
commit | 9b77d946990e7497469bb98171b90b4f3ab186a9 (patch) | |
tree | eed7aa5c0a82caf64f88a02fa986665710c3f64b /scripts/qapi/introspect.py | |
parent | qapi/introspect.py: Type _gen_tree variants as Sequence[str] (diff) | |
download | qemu-9b77d946990e7497469bb98171b90b4f3ab186a9.tar.gz qemu-9b77d946990e7497469bb98171b90b4f3ab186a9.tar.xz qemu-9b77d946990e7497469bb98171b90b4f3ab186a9.zip |
qapi/introspect.py: set _gen_tree's default ifcond argument to ()
We don't need to create an empty, mutable list to pass to _gen_tree;
since it is now typed as a Sequence, we can use the empty tuple as a
default and omit the argument.
Signed-off-by: John Snow <jsnow@redhat.com>
Message-Id: <20210216021809.134886-19-jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'scripts/qapi/introspect.py')
-rw-r--r-- | scripts/qapi/introspect.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index d0b0fd19ed..9a348ca2e5 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -254,7 +254,7 @@ const QLitObject %(c_name)s = %(c_string)s; return [Annotated(f.name, f.ifcond) for f in features] def _gen_tree(self, name: str, mtype: str, obj: Dict[str, object], - ifcond: Sequence[str], + ifcond: Sequence[str] = (), features: Sequence[QAPISchemaFeature] = ()) -> None: """ Build and append a SchemaInfo object to self._trees. @@ -302,7 +302,7 @@ const QLitObject %(c_name)s = %(c_string)s; def visit_builtin_type(self, name: str, info: Optional[QAPISourceInfo], json_type: str) -> None: - self._gen_tree(name, 'builtin', {'json-type': json_type}, []) + self._gen_tree(name, 'builtin', {'json-type': json_type}) def visit_enum_type(self, name: str, info: Optional[QAPISourceInfo], ifcond: Sequence[str], |