[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 13/19] qapi/schema: fix typing for QAPISchemaVariants.tag_mem
|
From: |
Markus Armbruster |
|
Subject: |
Re: [PATCH 13/19] qapi/schema: fix typing for QAPISchemaVariants.tag_member |
|
Date: |
Wed, 22 Nov 2023 15:05:23 +0100 |
|
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
John Snow <jsnow@redhat.com> writes:
> There are two related changes here:
>
> (1) We need to perform type narrowing for resolving the type of
> tag_member during check(), and
>
> (2) tag_member is a delayed initialization field, but we can hide it
> behind a property that raises an Exception if it's called too
> early. This simplifies the typing in quite a few places and avoids
> needing to assert that the "tag_member is not None" at a dozen
> callsites, which can be confusing and suggest the wrong thing to a
> drive-by contributor.
>
> Signed-off-by: John Snow <jsnow@redhat.com>
Without looking closely: review of PATCH 10 applies, doesn't it?
- Re: [PATCH 05/19] qapi/schema: make c_type() and json_type() abstract methods, (continued)
- [PATCH 14/19] qapi/schema: assert QAPISchemaVariants are QAPISchemaObjectType, John Snow, 2023/11/15
- [PATCH 13/19] qapi/schema: fix typing for QAPISchemaVariants.tag_member, John Snow, 2023/11/15
- Re: [PATCH 13/19] qapi/schema: fix typing for QAPISchemaVariants.tag_member,
Markus Armbruster <=
- [PATCH 17/19] qapi/schema: turn on mypy strictness, John Snow, 2023/11/15
- [PATCH 19/19] qapi/schema: refactor entity lookup helpers, John Snow, 2023/11/15
- [PATCH 18/19] qapi/schema: remove unnecessary asserts, John Snow, 2023/11/15
- [PATCH 15/19] qapi/parser: demote QAPIExpression to Dict[str, Any], John Snow, 2023/11/15
- [PATCH 16/19] qapi/schema: add type hints, John Snow, 2023/11/15