|
From: | John Snow |
Subject: | Re: [PATCH v5 36/36] qapi/visit.py: add type hint annotations |
Date: | Wed, 7 Oct 2020 12:43:17 -0400 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 |
On 10/7/20 9:00 AM, Markus Armbruster wrote:
More abuse of review to learn: even through we initialize with False, we still need the type hint?
Dunno.jsnow@scv ~/s/q/scripts (python-qapi-cleanup-pt1)> mypy --config-file=qapi/mypy.ini qapi/; qapi/visit.py:40: error: Function is missing a type annotation for one or more arguments
Found 1 error in 1 file (checked 14 source files) ...yup.It also serves the purpose of constraining the type to also avoid unions with things that might be false-ish. Looks silly, but maybe future mypy installments will afford us more chances to use inference. It doesn't right now.
--js
[Prev in Thread] | Current Thread | [Next in Thread] |