qemu-patch-raspberry4/scripts/qapi
John Snow ec9697ab3f qapi/commands: assert arg_type is not None
When boxed is True, expr.py asserts that we must have
arguments. Ultimately, this should mean that if boxed is True that
arg_type should be defined. Mypy cannot infer this, and does not support
'stateful' type inference, e.g.:

```
if x:
    assert y is not None

...

if x:
    y.etc()
```

does not work, because mypy does not statefully remember the conditional
assertion in the second block. Help mypy out by creating a new local
that it can track more easily.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-Id: <20210201193747.2169670-2-jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2021-02-08 14:15:58 +01:00
..
.flake8 qapi: delint using flake8 2020-10-10 11:37:47 +02:00
.isort.cfg qapi: enforce import order/styling with isort 2020-10-10 11:37:47 +02:00
__init__.py qapi-gen: New common driver for code and doc generators 2018-03-02 13:14:09 -06:00
commands.py qapi/commands: assert arg_type is not None 2021-02-08 14:15:58 +01:00
common.py qapi/common.py: move build_params into gen.py 2020-10-10 11:37:48 +02:00
error.py qapi: Use super() now we have Python 3 2020-03-05 09:24:11 +01:00
events.py qapi/events.py: Move comments into docstrings 2020-10-10 11:37:48 +02:00
expr.py qapi: enforce import order/styling with isort 2020-10-10 11:37:47 +02:00
gen.py qapi/gen.py: delint with pylint 2020-10-10 11:37:49 +02:00
introspect.py qapi: enforce import order/styling with isort 2020-10-10 11:37:47 +02:00
main.py qapi: Prefer explicit relative imports 2020-10-10 11:37:47 +02:00
mypy.ini qapi/visit.py: add type hint annotations 2020-10-10 11:37:49 +02:00
parser.py qapi: enforce import order/styling with isort 2020-10-10 11:37:47 +02:00
pylintrc qapi/visit.py: remove unused parameters from gen_visit_object 2020-10-10 11:37:49 +02:00
schema.py qapi: establish mypy type-checking baseline 2020-10-10 11:37:48 +02:00
source.py qapi/source.py: delint with pylint 2020-10-10 11:37:48 +02:00
types.py qapi/types.py: remove one-letter variables 2020-10-10 11:37:49 +02:00
visit.py qapi/visit.py: add type hint annotations 2020-10-10 11:37:49 +02:00