satisfy mypy
This commit is contained in:
parent
11a2e02210
commit
8c8154aaa0
2 changed files with 5 additions and 4 deletions
|
|
@ -25,14 +25,14 @@ class TArray(
|
|||
super(TArray, self).__init__(cs.Array(count, subcon, discard)) # type: ignore
|
||||
|
||||
def _decode(
|
||||
self, obj: ListContainer[ParsedType], context: Context, path: PathType
|
||||
self, obj: SubconParsedType, context: Context, path: PathType
|
||||
) -> ParsedType:
|
||||
return list(obj) # type: ignore
|
||||
|
||||
def _encode(
|
||||
self,
|
||||
obj: t.Any,
|
||||
obj: t.List[SubconParsedType],
|
||||
context: Context,
|
||||
path: PathType,
|
||||
) -> t.List[t.Any]:
|
||||
) -> SubconBuildTypes:
|
||||
return obj # type: ignore
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class TEnum(Adapter[int, int, EnumType, t.Union[int, str, EnumType]]):
|
|||
self.enum_type = enum_type
|
||||
|
||||
# init adatper
|
||||
super(TEnum, self).__init__(subcon) # type: ignore
|
||||
super(TEnum, self).__init__(subcon)
|
||||
|
||||
def _decode(self, obj: int, context: "cs.Context", path: "cs.PathType") -> EnumType:
|
||||
return self.enum_type(obj)
|
||||
|
|
@ -60,6 +60,7 @@ class TEnum(Adapter[int, int, EnumType, t.Union[int, str, EnumType]]):
|
|||
path: "cs.PathType",
|
||||
) -> int:
|
||||
try:
|
||||
# TODO: remove this. only strongly typed enums are allowed...
|
||||
if isinstance(obj, str):
|
||||
return int(self.enum_type[obj])
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue