Re: [PATCH 05/22] qapi/parser: Assert lexer value is a string

2021-04-27 Thread John Snow
On 4/27/21 8:30 AM, Markus Armbruster wrote: I assume you need this assertion for mypy. If yes, let's get the job done with minimal fuss. If no, please drop the assertion entirely. Yep, needed for mypy. You are right that these assertions are for clarifying postconditions of accept() that

Re: [PATCH 05/22] qapi/parser: Assert lexer value is a string

2021-04-27 Thread Markus Armbruster
John Snow writes: > On 4/24/21 4:33 AM, Markus Armbruster wrote: >> The second operand of assert provides no additional information. Please >> drop it. > > I don't agree with "no additional information", strictly. > > I left you a comment on gitlab before you started reviewing on-list. > What

Re: [PATCH 05/22] qapi/parser: Assert lexer value is a string

2021-04-26 Thread John Snow
On 4/24/21 4:33 AM, Markus Armbruster wrote: The second operand of assert provides no additional information. Please drop it. I don't agree with "no additional information", strictly. I left you a comment on gitlab before you started reviewing on-list. What I wrote there: "Markus: I know

Re: [PATCH 05/22] qapi/parser: Assert lexer value is a string

2021-04-24 Thread Markus Armbruster
John Snow writes: > The type checker can't narrow the type of the token value to string, > because it's only loosely correlated with the return token. > > We know that a token of '#' should always have a "str" value. > Add an assertion. > > Signed-off-by: John Snow > --- >

[PATCH 05/22] qapi/parser: Assert lexer value is a string

2021-04-21 Thread John Snow
The type checker can't narrow the type of the token value to string, because it's only loosely correlated with the return token. We know that a token of '#' should always have a "str" value. Add an assertion. Signed-off-by: John Snow --- scripts/qapi/parser.py | 1 + 1 file changed, 1