[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 14/22] qapi/parser: Remove superfluous list constructor
From: |
John Snow |
Subject: |
[PATCH 14/22] qapi/parser: Remove superfluous list constructor |
Date: |
Wed, 21 Apr 2021 23:07:12 -0400 |
A generator suffices (and quiets a pylint warning.)
Signed-off-by: John Snow <jsnow@redhat.com>
---
scripts/qapi/parser.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index cbdddc344e7..dbbd0fcbc2f 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -176,7 +176,7 @@ def _pragma(name: str, value: object, info: QAPISourceInfo)
-> None:
def _check(name: str, value: object) -> List[str]:
if (not isinstance(value, list) or
- any([not isinstance(elt, str) for elt in value])):
+ any(not isinstance(elt, str) for elt in value)):
raise QAPISemError(
info,
"pragma %s must be a list of strings" % name)
--
2.30.2
- Re: [PATCH 11/22] qapi/parser: Rework _check_pragma_list_of_str as a TypeGuard, (continued)
- [PATCH 14/22] qapi/parser: Remove superfluous list constructor,
John Snow <=
- [PATCH 17/22] CHECKPOINT, John Snow, 2021/04/21
- [PATCH 19/22] qapi: [WIP] Add type ignores for qapidoc.py, John Snow, 2021/04/21
- [PATCH 20/22] qapi: [WIP] Import QAPIDoc from qapidoc Signed-off-by: John Snow <address@hidden>, John Snow, 2021/04/21
- [PATCH 22/22] qapi: [WIP] Enable linters on parser.py, John Snow, 2021/04/21
- [PATCH 21/22] qapi: [WIP] Add QAPIDocError, John Snow, 2021/04/21
- [PATCH 13/22] qapi/parser: [RFC] overload the return type of get_expr, John Snow, 2021/04/21
- [PATCH 18/22] qapi: [WIP] Rip QAPIDoc out of parser.py, John Snow, 2021/04/21