[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 11/19] qapi/schema: fix QAPISchemaArrayType.check's call t
|
From: |
Markus Armbruster |
|
Subject: |
Re: [PATCH v2 11/19] qapi/schema: fix QAPISchemaArrayType.check's call to resolve_type |
|
Date: |
Tue, 16 Jan 2024 13:17:00 +0100 |
|
User-agent: |
Gnus/5.13 (Gnus v5.13) |
John Snow <jsnow@redhat.com> writes:
> Adjust the expression at the callsite to eliminate weak type
> introspection that believes this value can resolve to QAPISourceInfo; it
> cannot.
What do you mean by "weak type introspection"? mypy being underpowered?
> Signed-off-by: John Snow <jsnow@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 35638c7708a..43af756ed47 100644
> --- a/scripts/qapi/schema.py
> +++ b/scripts/qapi/schema.py
> @@ -403,7 +403,7 @@ def check(self, schema):
> super().check(schema)
> self.element_type = schema.resolve_type(
> self._element_type_name, self.info,
> - self.info and self.info.defn_meta)
> + self.info.defn_meta if self.info else None)
> assert not isinstance(self.element_type, QAPISchemaArrayType)
>
> def set_module(self, schema):
- [PATCH v2 04/19] qapi/schema: declare type for QAPISchemaObjectTypeMember.type, (continued)
- [PATCH v2 04/19] qapi/schema: declare type for QAPISchemaObjectTypeMember.type, John Snow, 2024/01/12
- [PATCH v2 05/19] qapi/schema: declare type for QAPISchemaArrayType.element_type, John Snow, 2024/01/12
- [PATCH v2 08/19] qapi/schema: add type narrowing to lookup_type(), John Snow, 2024/01/12
- [PATCH v2 13/19] qapi/schema: split "checked" field into "checking" and "checked", John Snow, 2024/01/12
- [PATCH v2 11/19] qapi/schema: fix QAPISchemaArrayType.check's call to resolve_type, John Snow, 2024/01/12
- Re: [PATCH v2 11/19] qapi/schema: fix QAPISchemaArrayType.check's call to resolve_type,
Markus Armbruster <=
- [PATCH v2 14/19] qapi/schema: fix typing for QAPISchemaVariants.tag_member, John Snow, 2024/01/12
- [PATCH v2 15/19] qapi/schema: assert inner type of QAPISchemaVariants in check_clash(), John Snow, 2024/01/12
- [PATCH v2 12/19] qapi/schema: assert info is present when necessary, John Snow, 2024/01/12
- [PATCH v2 18/19] qapi/schema: turn on mypy strictness, John Snow, 2024/01/12
- [PATCH v2 19/19] qapi/schema: remove unnecessary asserts, John Snow, 2024/01/12
- [PATCH v2 10/19] qapi: use schema.resolve_type instead of schema.lookup_type, John Snow, 2024/01/12