Re: [PATCH 12/22] qapi/parser: add type hint annotations

2021-05-05 Thread John Snow
On 4/27/21 4:43 AM, Markus Armbruster wrote: John Snow writes: On 4/25/21 8:34 AM, Markus Armbruster wrote: value: object isn't wrong, but why not _ExprValue? Updated excuse: because all the way back outside in _parse, we know that: 1. expr is a dict (because of get_expr(False)) 2. expr[

Re: [PATCH 12/22] qapi/parser: add type hint annotations

2021-05-05 Thread John Snow
On 4/21/21 11:07 PM, John Snow wrote: +self.exprs: List[Expression] = [] I did indeed intend to use Expression to mean TopLevelExpr ... However, in this case, that's not what actually gets stored here. I tricked myself! This stores the dict that associates 'expr', 'doc' and 'info'.

Re: [PATCH 12/22] qapi/parser: add type hint annotations

2021-04-27 Thread Markus Armbruster
John Snow writes: > On 4/25/21 8:34 AM, Markus Armbruster wrote: >> value: object isn't wrong, but why not _ExprValue? >> > > Updated excuse: > > because all the way back outside in _parse, we know that: > > 1. expr is a dict (because of get_expr(False)) > 2. expr['pragma'] is also a dict, becau

Re: [PATCH 12/22] qapi/parser: add type hint annotations

2021-04-27 Thread Markus Armbruster
John Snow writes: > On 4/25/21 8:34 AM, Markus Armbruster wrote: >> John Snow writes: >> >>> Annotations do not change runtime behavior. >>> This commit *only* adds annotations. >>> >>> (Annotations for QAPIDoc are in a later commit.) >>> >>> Signed-off-by: John Snow >>> --- >>> scripts/qapi

Re: [PATCH 12/22] qapi/parser: add type hint annotations

2021-04-26 Thread John Snow
On 4/25/21 8:34 AM, Markus Armbruster wrote: value: object isn't wrong, but why not _ExprValue? Updated excuse: because all the way back outside in _parse, we know that: 1. expr is a dict (because of get_expr(False)) 2. expr['pragma'] is also a dict, because we explicitly check it there. 3.

Re: [PATCH 12/22] qapi/parser: add type hint annotations

2021-04-26 Thread John Snow
On 4/25/21 8:34 AM, Markus Armbruster wrote: John Snow writes: Annotations do not change runtime behavior. This commit *only* adds annotations. (Annotations for QAPIDoc are in a later commit.) Signed-off-by: John Snow --- scripts/qapi/parser.py | 61 ---

Re: [PATCH 12/22] qapi/parser: add type hint annotations

2021-04-25 Thread Markus Armbruster
John Snow writes: > Annotations do not change runtime behavior. > This commit *only* adds annotations. > > (Annotations for QAPIDoc are in a later commit.) > > Signed-off-by: John Snow > --- > scripts/qapi/parser.py | 61 -- > 1 file changed, 41 insertion

[PATCH 12/22] qapi/parser: add type hint annotations

2021-04-21 Thread John Snow
Annotations do not change runtime behavior. This commit *only* adds annotations. (Annotations for QAPIDoc are in a later commit.) Signed-off-by: John Snow --- scripts/qapi/parser.py | 61 -- 1 file changed, 41 insertions(+), 20 deletions(-) diff --git a/