[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 13/15] qapi/parser: Remove superfluous list comprehension
From: |
John Snow |
Subject: |
[PATCH v3 13/15] qapi/parser: Remove superfluous list comprehension |
Date: |
Wed, 19 May 2021 14:39:49 -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 419e36c8702..b0f18c0d176 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 v3 02/15] qapi: Add test for nonexistent schema file, (continued)
- [PATCH v3 02/15] qapi: Add test for nonexistent schema file, John Snow, 2021/05/19
- [PATCH v3 04/15] qapi/parser: factor parsing routine into method, John Snow, 2021/05/19
- [PATCH v3 03/15] qapi/source: Remove line number from QAPISourceInfo initializer, John Snow, 2021/05/19
- [PATCH v3 11/15] qapi/parser: Rework _check_pragma_list_of_str as a TypeGuard, John Snow, 2021/05/19
- [PATCH v3 10/15] qapi/parser: Fix token membership tests when token can be None, John Snow, 2021/05/19
- [PATCH v3 14/15] qapi/parser: allow 'ch' variable name, John Snow, 2021/05/19
- [PATCH v3 09/15] qapi: add must_match helper, John Snow, 2021/05/19
- [PATCH v3 08/15] qapi/parser: Use @staticmethod where appropriate, John Snow, 2021/05/19
- [PATCH v3 06/15] qapi/parser: enforce all top-level expressions must be dict in _parse(), John Snow, 2021/05/19
- [PATCH v3 12/15] qapi/parser: add type hint annotations, John Snow, 2021/05/19
- [PATCH v3 13/15] qapi/parser: Remove superfluous list comprehension,
John Snow <=
- Re: [PATCH v3 00/15] qapi: static typing conversion, pt5a, Markus Armbruster, 2021/05/20