ifcond's initialization allows a fairly confusing type, but we want to assert that after the QAPISchema is built, this always returns a List[str]. Add an assertion to allow us to say that.
(Note: Technically, I only assert that it's a list -- but type hints that will be added later will make it clear that the only possible list we could have here is a list[str], and this assertion is sufficient to prove the point to mypy.) Signed-off-by: John Snow <js...@redhat.com> --- scripts/qapi/schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py index b35f741c6f..62b1a7e890 100644 --- a/scripts/qapi/schema.py +++ b/scripts/qapi/schema.py @@ -88,7 +88,7 @@ def set_module(self, schema): @property def ifcond(self): - assert self._checked + assert self._checked and isinstance(self._ifcond, list) return self._ifcond def is_implicit(self): -- 2.26.2