mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-03 04:21:13 +00:00
Use correct default type for str (#8623)
* [Python] Use correct type for str with None Otherwise mypy will correctly flag code like this def __init__(self): self.fooBar = None # type: Optional[str] error: Incompatible types in assignment (expression has type "None", variable has type "str") * [Python] Make list type optional as they can contain None
This commit is contained in:
@@ -105,7 +105,7 @@ class NestedUnionTestT(object):
|
||||
|
||||
# NestedUnionTestT
|
||||
def __init__(self):
|
||||
self.name = None # type: str
|
||||
self.name = None # type: Optional[str]
|
||||
self.dataType = 0 # type: int
|
||||
self.data = None # type: Union[None, MyGame.Example.NestedUnion.Vec3.Vec3T, MyGame.Example.NestedUnion.TestSimpleTableWithEnum.TestSimpleTableWithEnumT]
|
||||
self.id = 0 # type: int
|
||||
|
||||
Reference in New Issue
Block a user