mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-24 16:06:10 +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:
@@ -240,8 +240,8 @@ class MonsterExtraT(object):
|
||||
self.f1 = float('nan') # type: float
|
||||
self.f2 = float('inf') # type: float
|
||||
self.f3 = float('-inf') # type: float
|
||||
self.dvec = None # type: List[float]
|
||||
self.fvec = None # type: List[float]
|
||||
self.dvec = None # type: Optional[List[float]]
|
||||
self.fvec = None # type: Optional[List[float]]
|
||||
|
||||
@classmethod
|
||||
def InitFromBuf(cls, buf, pos):
|
||||
|
||||
Reference in New Issue
Block a user