[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 13/21] qapi/parser: Remove superfluous list comprehension
From: |
John Snow |
Subject: |
[PATCH v2 13/21] qapi/parser: Remove superfluous list comprehension |
Date: |
Tue, 11 May 2021 18:05:53 -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 631863bac14..e80e0a7d965 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_list_str(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
- [PATCH v2 04/21] qapi/parser: factor parsing routine into method, (continued)
- [PATCH v2 04/21] qapi/parser: factor parsing routine into method, John Snow, 2021/05/11
- [PATCH v2 09/21] qapi: add must_match helper, John Snow, 2021/05/11
- [PATCH v2 08/21] qapi/parser: Use @staticmethod where appropriate, John Snow, 2021/05/11
- [PATCH v2 10/21] qapi/parser: Fix token membership tests when token can be None, John Snow, 2021/05/11
- [PATCH v2 11/21] qapi/parser: Rework _check_pragma_list_of_str as a TypeGuard, John Snow, 2021/05/11
- [PATCH v2 12/21] qapi/parser: add type hint annotations, John Snow, 2021/05/11
- [PATCH v2 13/21] qapi/parser: Remove superfluous list comprehension,
John Snow <=
- [PATCH v2 15/21] qapi/parser: add docstrings, John Snow, 2021/05/11
- [PATCH v2 14/21] qapi/parser: allow 'ch' variable name, John Snow, 2021/05/11
- [PATCH v2 16/21] CHECKPOINT, John Snow, 2021/05/11
- [PATCH v2 19/21] qapi: [WIP] Import QAPIDoc from qapidoc Signed-off-by: John Snow <address@hidden>, John Snow, 2021/05/11
- [PATCH v2 18/21] qapi: [WIP] Add type ignores for qapidoc.py, John Snow, 2021/05/11
- [PATCH v2 21/21] qapi: [WIP] Enable linters on parser.py, John Snow, 2021/05/11
- [PATCH v2 20/21] qapi: [WIP] Add QAPIDocError, John Snow, 2021/05/11
- [PATCH v2 17/21] qapi: [WIP] Rip QAPIDoc out of parser.py, John Snow, 2021/05/11