[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 19/38] qapi/commands.py: Don't re-bind to variable of differen
From: |
John Snow |
Subject: |
[PATCH v2 19/38] qapi/commands.py: Don't re-bind to variable of different type |
Date: |
Tue, 22 Sep 2020 17:00:42 -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>
---
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 9b3f24b8ed..389dd879a6 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
- Re: [PATCH v2 13/38] qapi/common.py: add type hint annotations, (continued)
Re: [PATCH v2 13/38] qapi/common.py: add type hint annotations, Cleber Rosa, 2020/09/23
[PATCH v2 14/38] qapi/common.py: Convert comments into docstrings, and elaborate, John Snow, 2020/09/22
[PATCH v2 15/38] qapi/common.py: move build_params into gen.py, John Snow, 2020/09/22
[PATCH v2 19/38] qapi/commands.py: Don't re-bind to variable of different type,
John Snow <=
[PATCH v2 16/38] qapi: establish mypy type-checking baseline, John Snow, 2020/09/22
[PATCH v2 21/38] qapi/commands.py: enable checking with mypy, John Snow, 2020/09/22
[PATCH v2 22/38] qapi/source.py: add type hint annotations, John Snow, 2020/09/22