[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 21/36] qapi/commands.py: Don't re-bind to variable of differen
From: |
John Snow |
Subject: |
[PATCH v6 21/36] qapi/commands.py: Don't re-bind to variable of different type |
Date: |
Fri, 9 Oct 2020 12:15:43 -0400 |
Mypy isn't a fan of rebinding a variable with a new data type.
It's easy enough to avoid.
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Cleber Rosa <crosa@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
---
scripts/qapi/commands.py | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py
index 88ba11c40e1..b0abb985a4e 100644
--- a/scripts/qapi/commands.py
+++ b/scripts/qapi/commands.py
@@ -198,14 +198,12 @@ def gen_register_command(name, success_response,
allow_oob, allow_preconfig,
if not options:
options = ['QCO_NO_OPTIONS']
- options = " | ".join(options)
-
ret = mcgen('''
qmp_register_command(cmds, "%(name)s",
qmp_marshal_%(c_name)s, %(opts)s);
''',
name=name, c_name=c_name(name),
- opts=options)
+ opts=" | ".join(options))
return ret
--
2.26.2
- [PATCH v6 19/36] qapi/events.py: add type hint annotations, (continued)
- [PATCH v6 19/36] qapi/events.py: add type hint annotations, John Snow, 2020/10/09
- [PATCH v6 18/36] qapi: establish mypy type-checking baseline, John Snow, 2020/10/09
- [PATCH v6 23/36] qapi/commands.py: enable checking with mypy, John Snow, 2020/10/09
- [PATCH v6 24/36] qapi/source.py: add type hint annotations, John Snow, 2020/10/09
- [PATCH v6 26/36] qapi/gen.py: Fix edge-case of _is_user_module, John Snow, 2020/10/09
- [PATCH v6 22/36] qapi/commands.py: add type hint annotations, John Snow, 2020/10/09
- [PATCH v6 25/36] qapi/source.py: delint with pylint, John Snow, 2020/10/09
- [PATCH v6 21/36] qapi/commands.py: Don't re-bind to variable of different type,
John Snow <=
- [PATCH v6 28/36] qapi/gen.py: Enable checking with mypy, John Snow, 2020/10/09
- [PATCH v6 27/36] qapi/gen.py: add type hint annotations, John Snow, 2020/10/09
- [PATCH v6 30/36] qapi/gen.py: update write() to be more idiomatic, John Snow, 2020/10/09
- [PATCH v6 33/36] qapi/types.py: remove one-letter variables, John Snow, 2020/10/09
- [PATCH v6 29/36] qapi/gen.py: Remove unused parameter, John Snow, 2020/10/09
- [PATCH v6 35/36] qapi/visit.py: remove unused parameters from gen_visit_object, John Snow, 2020/10/09
- [PATCH v6 34/36] qapi/visit.py: assert tag_member contains a QAPISchemaEnumType, John Snow, 2020/10/09
- [PATCH v6 32/36] qapi/types.py: add type hint annotations, John Snow, 2020/10/09
- [PATCH v6 36/36] qapi/visit.py: add type hint annotations, John Snow, 2020/10/09
- [PATCH v6 31/36] qapi/gen.py: delint with pylint, John Snow, 2020/10/09