[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 19/37] qapi/commands.py: Don't re-bind to variable of different t
From: |
John Snow |
Subject: |
[PATCH 19/37] qapi/commands.py: Don't re-bind to variable of different type |
Date: |
Tue, 15 Sep 2020 18:40:09 -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 0c0fe854fe..b215e58357 100644
--- a/scripts/qapi/commands.py
+++ b/scripts/qapi/commands.py
@@ -194,14 +194,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 12/37] qapi/common.py: check with pylint, (continued)
- [PATCH 12/37] qapi/common.py: check with pylint, John Snow, 2020/09/15
- [PATCH 11/37] qapi/common.py: Replace one-letter 'c' variable, John Snow, 2020/09/15
- [PATCH 14/37] qapi/common.py: Move comments into docstrings, John Snow, 2020/09/15
- [PATCH 13/37] qapi/common.py: add notational type hints, John Snow, 2020/09/15
- [PATCH 15/37] qapi/common.py: split build_params into new file, John Snow, 2020/09/15
- [PATCH 24/37] qapi/gen.py: Fix edge-case of _is_user_module, John Snow, 2020/09/15
- [PATCH 21/37] qapi/commands.py: enable checking with mypy, John Snow, 2020/09/15
- [PATCH 16/37] qapi: establish mypy type-checking baseline, John Snow, 2020/09/15
- [PATCH 18/37] qapi/events.py: Move comments into docstrings, John Snow, 2020/09/15
- [PATCH 22/37] qapi/source.py: add notational type hints, John Snow, 2020/09/15
- [PATCH 19/37] qapi/commands.py: Don't re-bind to variable of different type,
John Snow <=
- [PATCH 17/37] qapi/events.py: add notational type hints, John Snow, 2020/09/15
- [PATCH 20/37] qapi/commands.py: add notational type hints, John Snow, 2020/09/15
- [PATCH 23/37] qapi/source.py: delint with pylint, John Snow, 2020/09/15
- [PATCH 28/37] qapi/gen.py: update write() to be more idiomatic, John Snow, 2020/09/15
- [PATCH 29/37] qapi/gen.py: delint with pylint, John Snow, 2020/09/15
- [PATCH 27/37] qapi/gen.py: Remove unused parameter, John Snow, 2020/09/15
- [PATCH 26/37] qapi/gen.py: Enable checking with mypy, John Snow, 2020/09/15
- [PATCH 30/37] qapi/introspect.py: Add a typed 'extra' structure, John Snow, 2020/09/15
- [PATCH 25/37] qapi/gen.py: add notational type hints, John Snow, 2020/09/15
- [PATCH 34/37] qapi/types.py: add notational type hints, John Snow, 2020/09/15