Re: [PATCH v2 30/38] qapi/introspect.py: Add a typed 'extra' structure

2020-09-23 Thread John Snow
On 9/23/20 12:13 PM, Eduardo Habkost wrote: On Tue, Sep 22, 2020 at 05:00:53PM -0400, John Snow wrote: Typing arbitrarily shaped dicts with mypy is difficult prior to Python 3.8; using explicit structures is nicer. Since we always define an Extra type now, the return type of _make_tree simplifi

Re: [PATCH v2 30/38] qapi/introspect.py: Add a typed 'extra' structure

2020-09-23 Thread Eduardo Habkost
On Tue, Sep 22, 2020 at 05:00:53PM -0400, John Snow wrote: > Typing arbitrarily shaped dicts with mypy is difficult prior to Python > 3.8; using explicit structures is nicer. > > Since we always define an Extra type now, the return type of _make_tree > simplifies and always returns the tuple. > >

[PATCH v2 30/38] qapi/introspect.py: Add a typed 'extra' structure

2020-09-22 Thread John Snow
Typing arbitrarily shaped dicts with mypy is difficult prior to Python 3.8; using explicit structures is nicer. Since we always define an Extra type now, the return type of _make_tree simplifies and always returns the tuple. Signed-off-by: John Snow --- scripts/qapi/introspect.py | 31 +