aboutsummaryrefslogtreecommitdiff
path: root/qga/qapi-schema.json
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2021-05-19 14:39:47 -0400
committerMarkus Armbruster <armbru@redhat.com>2021-05-20 11:28:28 +0200
commit03386200b90c68953e217baedd3716cdee9ed169 (patch)
tree23903345582e9b0da7f83e0686cd2dac0f23320b /qga/qapi-schema.json
parentc256263f3df0eaf9011405cdaee354380beb6dc5 (diff)
downloadqemu-03386200b90c68953e217baedd3716cdee9ed169.zip
qemu-03386200b90c68953e217baedd3716cdee9ed169.tar.gz
qemu-03386200b90c68953e217baedd3716cdee9ed169.tar.bz2
qapi/parser: Rework _check_pragma_list_of_str as a TypeGuard
TypeGuards wont exist in Python proper until 3.10. Ah well. We can hack up our own by declaring this function to return the type we claim it checks for and using this to safely downcast object -> List[str]. In so doing, I bring this function under _pragma so it can use the 'info' object in its closure. Having done this, _pragma also now no longer needs to take a 'self' parameter, so drop it. To help with line-length, and with the context evident from its new scope, rename the function to the shorter check_list_str(). Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20210519183951.3946870-12-jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'qga/qapi-schema.json')
0 files changed, 0 insertions, 0 deletions