From 084c39a1ff0d9be160398683e16dd4b6ef7a94b5 Mon Sep 17 00:00:00 2001 From: Tim Rid <6593626+timrid@users.noreply.github.com> Date: Sat, 13 Mar 2021 17:54:06 +0100 Subject: [PATCH] removed unused type ignore --- construct_typed/tunion.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/construct_typed/tunion.py b/construct_typed/tunion.py index b575943..4651563 100644 --- a/construct_typed/tunion.py +++ b/construct_typed/tunion.py @@ -11,7 +11,7 @@ DataclassType = t.TypeVar("DataclassType") def TUnionField( - subcon: Construct[ParsedType, BuildTypes], + subcon: Construct[ParsedType, t.Any], doc: t.Optional[str] = None, parsed: t.Optional[t.Callable[[t.Any, "cs.Context"], None]] = None, ) -> ParsedType: @@ -28,9 +28,9 @@ def TUnionField( # some subcons have a predefined default value. all other have "None" default: t.Any = None if isinstance(subcon, (cs.Const, cs.Default)): - if callable(subcon.value): # type: ignore + if callable(subcon.value): raise ValueError("lamda as default is not supported") - default = subcon.value # type: ignore + default = subcon.value # if subcon builds from "None", set default to "None" field = dataclasses.field(