diff options
author | John Snow <jsnow@redhat.com> | 2021-02-15 21:18:04 -0500 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2021-02-18 19:45:20 +0100 |
commit | 82b52f6b84585f1ea2a6ceb9fc0f264e3b13ed48 (patch) | |
tree | 04f8ac136cb5df583b5f37b035e4aa77b0418e7c /scripts/qapi/mypy.ini | |
parent | cf5db2142b674ebab8e0799fd07e3884cfb00fc5 (diff) | |
download | qemu-82b52f6b84585f1ea2a6ceb9fc0f264e3b13ed48.zip qemu-82b52f6b84585f1ea2a6ceb9fc0f264e3b13ed48.tar.gz qemu-82b52f6b84585f1ea2a6ceb9fc0f264e3b13ed48.tar.bz2 |
qapi/introspect.py: add type hint annotations
NB: The type aliases (SchemaInfo et al) declare intent for some of the
"dictly-typed" objects we pass around in introspect.py. They do not
enforce the shape of those objects, and cannot, until Python 3.7 or
later. (And even then, it may not be "worth it".)
Annotations are also added to the QAPISchemaEntity __init__ method in
schema.py to allow mypy to statically prove the type of typ.name,
needed to prove the return type of
QAPISchemaGenIntrospectVisitor._use_type().
Signed-off-by: John Snow <jsnow@redhat.com>
Message-Id: <20210216021809.134886-15-jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Note on QAPISchemaEntity.__init__() squashed into commit message,
Comment wrapped to conform to PEP 8]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'scripts/qapi/mypy.ini')
-rw-r--r-- | scripts/qapi/mypy.ini | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/scripts/qapi/mypy.ini b/scripts/qapi/mypy.ini index 04bd5db..0a000d5 100644 --- a/scripts/qapi/mypy.ini +++ b/scripts/qapi/mypy.ini @@ -13,11 +13,6 @@ disallow_untyped_defs = False disallow_incomplete_defs = False check_untyped_defs = False -[mypy-qapi.introspect] -disallow_untyped_defs = False -disallow_incomplete_defs = False -check_untyped_defs = False - [mypy-qapi.parser] disallow_untyped_defs = False disallow_incomplete_defs = False |