Re: [PATCH RFC 18/32] python//qmp.py: add casts to JSON deserialization

2020-05-26 Thread Philippe Mathieu-Daudé
On 5/14/20 7:53 AM, John Snow wrote: > mypy and python type hints are not powerful enough to properly describe > JSON messages in Python 3.6. The best we can do, generally, is describe > them as Dict[str, Any]. > > Add casts to coerce this type for static analysis; but do NOT enforce > this type a

[PATCH RFC 18/32] python//qmp.py: add casts to JSON deserialization

2020-05-13 Thread John Snow
mypy and python type hints are not powerful enough to properly describe JSON messages in Python 3.6. The best we can do, generally, is describe them as Dict[str, Any]. Add casts to coerce this type for static analysis; but do NOT enforce this type at runtime in any way. Note: Python 3.8 adds a Ty