[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 12/16] qapi/expr.py: Add docstrings
From: |
Eduardo Habkost |
Subject: |
Re: [PATCH 12/16] qapi/expr.py: Add docstrings |
Date: |
Wed, 23 Sep 2020 16:16:27 -0400 |
On Tue, Sep 22, 2020 at 05:13:09PM -0400, John Snow wrote:
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
[...]
> @@ -160,6 +244,18 @@ def check_type(value: Optional[object],
> source: str,
> allow_array: bool = False,
> allow_dict: Union[bool, str] = False) -> None:
> + """
> + Check the QAPI type of `value`. [RW]
> +
> + Python types of `str` or `None` are always allowed.
> +
> + :param value: The value to check.
> + :param info: QAPI Source file information.
> + :param source: Human readable string describing "what" the value is.
> + :param allow_array: Allow a `List[str]` of length 1,
> + which indicates an Array<T> type.
> + :param allow_dict: Allow a dict, treated as an anonymous type.
I was hoping the docstring would explain what happens when
allow_dict is a string.
--
Eduardo
- [PATCH 09/16] qapi/expr.py: rewrite check_if, (continued)
- [PATCH 09/16] qapi/expr.py: rewrite check_if, John Snow, 2020/09/22
- [PATCH 10/16] qapi/expr.py: Remove single-letter variable, John Snow, 2020/09/22
- [PATCH 11/16] qapi/expr.py: enable pylint checks, John Snow, 2020/09/22
- [PATCH 12/16] qapi/expr.py: Add docstrings, John Snow, 2020/09/22
- [PATCH 13/16] qapi/expr.py: Modify check_keys to accept any Iterable, John Snow, 2020/09/22
- [PATCH 15/16] qapi/expr.py: move related checks inside check_xxx functions, John Snow, 2020/09/22