[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 14/15] qapi/introspect.py: Add docstring to _tree_to_qlit
From: |
Markus Armbruster |
Subject: |
Re: [PATCH v5 14/15] qapi/introspect.py: Add docstring to _tree_to_qlit |
Date: |
Mon, 08 Feb 2021 16:45:29 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
John Snow <jsnow@redhat.com> writes:
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
> scripts/qapi/introspect.py | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py
> index 2a39726f40a..2b338abe2cf 100644
> --- a/scripts/qapi/introspect.py
> +++ b/scripts/qapi/introspect.py
> @@ -97,6 +97,14 @@ def __init__(self, value: _NodeT, ifcond: Iterable[str],
> def _tree_to_qlit(obj: TreeValue,
> level: int = 0,
> dict_value: bool = False) -> str:
> + """
> + Convert the type tree into a QLIT C string, recursively.
> +
> + :param obj: The value to convert.
> + :param level: The indentation level for this particular value.
> + :param dict_value: True when the value being processed belongs to a
> + dict key; which suppresses the output indent.
> + """
>
> def indent(level: int) -> str:
> return level * 4 * ' '
Might want to mention @obj may not be Annotated when dict_value=True.
Not a demand.
- Re: [PATCH v5 09/15] qapi/introspect.py: create a typed 'Annotated' data strutcure, (continued)
- [PATCH v5 11/15] qapi/introspect.py: improve readability of _tree_to_qlit, John Snow, 2021/02/03
- [PATCH v5 12/15] qapi/introspect.py: add type hint annotations, John Snow, 2021/02/03
- [PATCH v5 13/15] qapi/introspect.py: add introspect.json dummy types, John Snow, 2021/02/03
- [PATCH v5 08/15] qapi/introspect.py: Introduce preliminary tree typing, John Snow, 2021/02/03
- [PATCH v5 14/15] qapi/introspect.py: Add docstring to _tree_to_qlit, John Snow, 2021/02/03
- Re: [PATCH v5 14/15] qapi/introspect.py: Add docstring to _tree_to_qlit,
Markus Armbruster <=
- [PATCH v5 15/15] qapi/introspect.py: Update copyright and authors list, John Snow, 2021/02/03