@@ -179,7 +179,7 @@ def _is_list_of_dataclasses_type(dtype: TypeAnnotation) -> bool:
179
179
TypeError: If the input is not a valid `TypeAnnotation` type (see above).
180
180
"""
181
181
if not isinstance (dtype , TYPE_ANNOTATION_TYPES ):
182
- raise TypeError (f"Expected ` type` , got { type (dtype )} : { dtype } " )
182
+ raise TypeError (f"Expected type annotation , got { type (dtype )} : { dtype } " )
183
183
184
184
origin = get_origin (dtype )
185
185
args = get_args (dtype )
@@ -210,7 +210,7 @@ def _is_optional_type(dtype: TypeAnnotation) -> bool:
210
210
TypeError: If the input is not a valid `TypeAnnotation` type (see above).
211
211
"""
212
212
if not isinstance (dtype , TYPE_ANNOTATION_TYPES ):
213
- raise TypeError (f"Expected ` type` , got { type (dtype )} : { dtype } " )
213
+ raise TypeError (f"Expected type annotation , got { type (dtype )} : { dtype } " )
214
214
215
215
origin = get_origin (dtype )
216
216
args = get_args (dtype )
@@ -238,10 +238,10 @@ def _unpack_optional_type(dtype: TypeAnnotation) -> type:
238
238
ValueError: If the input type is not `Optional[T]`.
239
239
"""
240
240
if not isinstance (dtype , TYPE_ANNOTATION_TYPES ):
241
- raise TypeError (f"Expected ` type` , got { type (dtype )} : { dtype } " )
241
+ raise TypeError (f"Expected type annotation , got { type (dtype )} : { dtype } " )
242
242
243
243
if not _is_optional_type (dtype ):
244
- raise ValueError (f"Expected Optional[T], got { type (dtype )} : { dtype } " )
244
+ raise ValueError (f"Expected ` Optional[T]` , got { type (dtype )} : { dtype } " )
245
245
246
246
args = get_args (dtype )
247
247
0 commit comments