Skip to content

Commit be278ba

Browse files
author
desert
committed
Fix imports
1 parent 6fdcc35 commit be278ba

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/desert/_make.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def class_schema(
105105
fields = attr.fields(clazz)
106106
elif issubclass(clazz, (list, dict)):
107107
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] "
109109
f"instead of list and dict. Got {clazz}."
110110
)
111111
else:
@@ -115,7 +115,7 @@ def class_schema(
115115
attributes = {k: v for k, v in inspect.getmembers(clazz) if not k.startswith("_")}
116116
# Update the schema members to contain marshmallow fields instead of dataclass fields
117117

118-
hints = typing.get_type_hints(clazz)
118+
hints = t.get_type_hints(clazz)
119119
for field in fields:
120120
if field.init:
121121
attributes[field.name] = field_for_schema(
@@ -181,7 +181,7 @@ def field_for_schema(
181181
>>> field_for_schema(enum.Enum("X", "a b c")).__class__
182182
<class 'marshmallow_enum.EnumField'>
183183
>>> import typing
184-
>>> field_for_schema(typing.Union[int,str]).__class__
184+
>>> field_for_schema(t.Union[int,str]).__class__
185185
<class 'marshmallow_union.Union'>
186186
>>> field_for_schema(t.NewType('UserId', int)).__class__
187187
<class 'marshmallow.fields.Integer'>
@@ -266,7 +266,7 @@ def field_for_schema(
266266

267267
field = marshmallow_union.Union(subfields)
268268

269-
# typing.NewType returns a function with a __supertype__ attribute
269+
# t.NewType returns a function with a __supertype__ attribute
270270
newtype_supertype = getattr(typ, "__supertype__", None)
271271
if newtype_supertype and inspect.isfunction(typ):
272272
metadata.setdefault("description", typ.__name__)

0 commit comments

Comments
 (0)