From c9d6f58fd4aca67b21ca37be352bcdc5003c59df Mon Sep 17 00:00:00 2001 From: Tim Rid <6593626+timrid@users.noreply.github.com> Date: Sat, 22 May 2021 17:32:23 +0200 Subject: [PATCH] fixed mypy errors --- construct_typed/tstruct.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/construct_typed/tstruct.py b/construct_typed/tstruct.py index 870c29c..883a10d 100644 --- a/construct_typed/tstruct.py +++ b/construct_typed/tstruct.py @@ -33,7 +33,7 @@ class TContainerMixin: setattr(self, key, value) @recursion_lock() - def __str__(self): + def __str__(self) -> str: indentation = "\n " text = [f"{self.__class__.__name__}: "] @@ -206,7 +206,12 @@ class TStruct(Adapter[t.Any, t.Any, ContainerType, ContainerType]): ) -def TBitStruct(container_type: t.Type[ContainerType], reverse: bool = False): +def TBitStruct( + container_type: t.Type[ContainerType], reverse: bool = False +) -> t.Union[ + cs.Transformed[ContainerType, ContainerType], + cs.Restreamed[ContainerType, ContainerType], +]: return cs.Bitwise(TStruct(container_type, reverse))