Re: [PATCH v4 10/19] qapi/expr.py: Add casts in a few select cases

2021-03-25 Thread John Snow
On 3/25/21 10:33 AM, Markus Armbruster wrote: John Snow writes: Casts are instructions to the type checker only, they aren't "safe" and should probably be avoided in general. In this case, when we perform type checking on a nested structure, the type of each field does not "stick". (See PEP 6

Re: [PATCH v4 10/19] qapi/expr.py: Add casts in a few select cases

2021-03-25 Thread Markus Armbruster
John Snow writes: > Casts are instructions to the type checker only, they aren't "safe" and > should probably be avoided in general. In this case, when we perform > type checking on a nested structure, the type of each field does not > "stick". > > (See PEP 647 for an example of "type narrowing"

[PATCH v4 10/19] qapi/expr.py: Add casts in a few select cases

2021-03-24 Thread John Snow
Casts are instructions to the type checker only, they aren't "safe" and should probably be avoided in general. In this case, when we perform type checking on a nested structure, the type of each field does not "stick". (See PEP 647 for an example of "type narrowing" that does "stick". It is avail