mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
qapi: type 'info' as Optional[QAPISourceInfo]
For everything typed so far, type this parameter as Optional[QAPISourceInfo]. In the most generic case, QAPISchemaEntity's info field may be None to represent types that come from built-in definitions. Although some Entity types may not currently have any built-in definitions, it is not easily possible to constrain the type except on an ad-hoc basis using assertions. It's easier and simpler, then, to just say it's always an Optional type. Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20210201193747.2169670-16-jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
cc0747f6b7
commit
4a82e468e7
5 changed files with 6 additions and 6 deletions
|
@ -336,7 +336,7 @@ class QAPISchemaGenVisitVisitor(QAPISchemaModularCVisitor):
|
|||
|
||||
def visit_enum_type(self,
|
||||
name: str,
|
||||
info: QAPISourceInfo,
|
||||
info: Optional[QAPISourceInfo],
|
||||
ifcond: List[str],
|
||||
features: List[QAPISchemaFeature],
|
||||
members: List[QAPISchemaEnumMember],
|
||||
|
@ -378,7 +378,7 @@ class QAPISchemaGenVisitVisitor(QAPISchemaModularCVisitor):
|
|||
|
||||
def visit_alternate_type(self,
|
||||
name: str,
|
||||
info: QAPISourceInfo,
|
||||
info: Optional[QAPISourceInfo],
|
||||
ifcond: List[str],
|
||||
features: List[QAPISchemaFeature],
|
||||
variants: QAPISchemaVariants) -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue