@@ -61,7 +61,7 @@ def get_generic_map(cls, class_type: Type[Any]) -> dict:
6161 gen_base = class_type .__orig_bases__ [0 ]
6262 class_org = get_origin (gen_base )
6363 args = get_args (gen_base )
64- generic_map = dict (zip (class_org .__parameters__ , args , strict = False ))
64+ generic_map = dict (zip (class_org .__parameters__ , args ))
6565 else :
6666 generic_map = {}
6767
@@ -122,9 +122,9 @@ def process_type(cls, input_type: type[Any]) -> list[TypeClass]:
122122 origin = get_origin (input_type )
123123 if origin is None :
124124 return [TypeClass (type_class = input_type )]
125- if origin in [ Union , types . UnionType ] :
125+ if origin is Union or getattr ( types , " UnionType" , None ) is origin :
126126 type_classes = []
127- input_types = [arg for arg in input_type .__args__ if arg != types . NoneType ]
127+ input_types = [arg for arg in input_type .__args__ if arg is not type ( None ) ]
128128 for type_item in input_types :
129129 origin = get_origin (type_item )
130130 if origin is None :
@@ -134,7 +134,7 @@ def process_type(cls, input_type: type[Any]) -> list[TypeClass]:
134134 TypeClass (
135135 type_class = origin ,
136136 inner_type = next (
137- (arg for arg in get_args (type_item ) if arg != types . NoneType ), None
137+ (arg for arg in get_args (type_item ) if arg is not type ( None ) ), None
138138 ),
139139 )
140140 )
@@ -145,7 +145,7 @@ def process_type(cls, input_type: type[Any]) -> list[TypeClass]:
145145 TypeClass (
146146 type_class = origin ,
147147 inner_type = next (
148- (arg for arg in get_args (input_type ) if arg != types . NoneType ), None
148+ (arg for arg in get_args (input_type ) if arg is not type ( None ) ), None
149149 ),
150150 )
151151 ]
0 commit comments