qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 12/16] qapi/expr.py: Add docstrings


From: John Snow
Subject: Re: [PATCH 12/16] qapi/expr.py: Add docstrings
Date: Thu, 24 Sep 2020 20:52:34 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0

On 9/23/20 4:16 PM, Eduardo Habkost wrote:
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.


Reasonable request!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]