[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/15] qapi/parser: Use @staticmethod where appropriate
From: |
Markus Armbruster |
Subject: |
[PULL 08/15] qapi/parser: Use @staticmethod where appropriate |
Date: |
Thu, 20 May 2021 19:52:49 +0200 |
From: John Snow <jsnow@redhat.com>
No self, no thank you!
(Quiets pylint warnings.)
Signed-off-by: John Snow <jsnow@redhat.com>
Message-Id: <20210519183951.3946870-9-jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
scripts/qapi/parser.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index 4959630ce6..7c71866195 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -130,7 +130,8 @@ def reject_expr_doc(doc):
"documentation for '%s' is not followed by the definition"
% doc.symbol)
- def _include(self, include, info, incl_fname, previously_included):
+ @staticmethod
+ def _include(include, info, incl_fname, previously_included):
incl_abs_fname = os.path.abspath(incl_fname)
# catch inclusion cycle
inf = info
@@ -151,7 +152,8 @@ def _include(self, include, info, incl_fname,
previously_included):
f"can't read include file '{incl_fname}': {err.strerror}"
) from err
- def _check_pragma_list_of_str(self, name, value, info):
+ @staticmethod
+ def _check_pragma_list_of_str(name, value, info):
if (not isinstance(value, list)
or any([not isinstance(elt, str) for elt in value])):
raise QAPISemError(
--
2.26.3
- [PULL 06/15] qapi/parser: enforce all top-level expressions must be dict in _parse(), (continued)
- [PULL 06/15] qapi/parser: enforce all top-level expressions must be dict in _parse(), Markus Armbruster, 2021/05/20
- [PULL 11/15] qapi/parser: Rework _check_pragma_list_of_str as a TypeGuard, Markus Armbruster, 2021/05/20
- [PULL 01/15] qapi/parser: Don't try to handle file errors, Markus Armbruster, 2021/05/20
- [PULL 04/15] qapi/parser: factor parsing routine into method, Markus Armbruster, 2021/05/20
- [PULL 15/15] qapi/parser: add docstrings, Markus Armbruster, 2021/05/20
- [PULL 13/15] qapi/parser: Remove superfluous list comprehension, Markus Armbruster, 2021/05/20
- [PULL 07/15] qapi/parser: assert object keys are strings, Markus Armbruster, 2021/05/20
- [PULL 02/15] qapi: Add test for nonexistent schema file, Markus Armbruster, 2021/05/20
- [PULL 05/15] qapi/parser: Assert lexer value is a string, Markus Armbruster, 2021/05/20
- [PULL 03/15] qapi/source: Remove line number from QAPISourceInfo initializer, Markus Armbruster, 2021/05/20
- [PULL 08/15] qapi/parser: Use @staticmethod where appropriate,
Markus Armbruster <=
- [PULL 12/15] qapi/parser: add type hint annotations, Markus Armbruster, 2021/05/20
- [PULL 14/15] qapi/parser: allow 'ch' variable name, Markus Armbruster, 2021/05/20
- Re: [PULL 00/15] QAPI patches patches for 2021-05-20, Peter Maydell, 2021/05/21