@@ -105,7 +105,7 @@ def class_schema(
105
105
fields = attr .fields (clazz )
106
106
elif issubclass (clazz , (list , dict )):
107
107
raise desert .exceptions .UnknownType (
108
- "Use parametrized generics like typing .List[int] or typing .Dict[str, int] "
108
+ "Use parametrized generics like t .List[int] or t .Dict[str, int] "
109
109
f"instead of list and dict. Got { clazz } ."
110
110
)
111
111
else :
@@ -115,7 +115,7 @@ def class_schema(
115
115
attributes = {k : v for k , v in inspect .getmembers (clazz ) if not k .startswith ("_" )}
116
116
# Update the schema members to contain marshmallow fields instead of dataclass fields
117
117
118
- hints = typing .get_type_hints (clazz )
118
+ hints = t .get_type_hints (clazz )
119
119
for field in fields :
120
120
if field .init :
121
121
attributes [field .name ] = field_for_schema (
@@ -181,7 +181,7 @@ def field_for_schema(
181
181
>>> field_for_schema(enum.Enum("X", "a b c")).__class__
182
182
<class 'marshmallow_enum.EnumField'>
183
183
>>> import typing
184
- >>> field_for_schema(typing .Union[int,str]).__class__
184
+ >>> field_for_schema(t .Union[int,str]).__class__
185
185
<class 'marshmallow_union.Union'>
186
186
>>> field_for_schema(t.NewType('UserId', int)).__class__
187
187
<class 'marshmallow.fields.Integer'>
@@ -266,7 +266,7 @@ def field_for_schema(
266
266
267
267
field = marshmallow_union .Union (subfields )
268
268
269
- # typing .NewType returns a function with a __supertype__ attribute
269
+ # t .NewType returns a function with a __supertype__ attribute
270
270
newtype_supertype = getattr (typ , "__supertype__" , None )
271
271
if newtype_supertype and inspect .isfunction (typ ):
272
272
metadata .setdefault ("description" , typ .__name__ )
0 commit comments