[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 08/21] qapi/parser: Use @staticmethod where appropriate
From: |
John Snow |
Subject: |
[PATCH v2 08/21] qapi/parser: Use @staticmethod where appropriate |
Date: |
Tue, 11 May 2021 18:05:48 -0400 |
No self, no thank you!
(Quiets pylint warnings.)
Signed-off-by: John Snow <jsnow@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 6d774df6d0a..5ef1b8935e6 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.30.2
- [PATCH v2 02/21] qapi: Add test for nonexistent schema file, (continued)
- [PATCH v2 02/21] qapi: Add test for nonexistent schema file, John Snow, 2021/05/11
- [PATCH v2 03/21] qapi/source: Remove line number from QAPISourceInfo initializer, John Snow, 2021/05/11
- [PATCH v2 07/21] qapi/parser: assert object keys are strings, John Snow, 2021/05/11
- [PATCH v2 05/21] qapi/parser: Assert lexer value is a string, John Snow, 2021/05/11
- [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 <=
- [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, 2021/05/11
- [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