Skip to content

Commit 765f581

Browse files
committed
Fix inspect types
1 parent a1b31e7 commit 765f581

1 file changed

Lines changed: 4 additions & 15 deletions

File tree

‎src/msgspec/inspect.py‎

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,8 @@
55
import enum
66
import uuid
77
from collections.abc import Iterable
8-
from typing import (
9-
Any,
10-
Final,
11-
Literal,
12-
Type as typing_Type,
13-
TypeVar,
14-
Union,
15-
)
16-
17-
try:
18-
from types import UnionType as _types_UnionType # type: ignore
19-
except Exception:
20-
_types_UnionType = type("UnionType", (), {}) # type: ignore
8+
from types import UnionType as _types_UnionType
9+
from typing import Any, Final, Literal, TypeVar, Union
2110

2211
try:
2312
from typing import TypeAliasType as _TypeAliasType # type: ignore
@@ -305,7 +294,7 @@ class EnumType(Type):
305294
The corresponding `enum.Enum` type.
306295
"""
307296

308-
cls: typing_Type[enum.Enum]
297+
cls: type[enum.Enum]
309298

310299

311300
class LiteralType(Type):
@@ -569,7 +558,7 @@ class StructType(Type):
569558
``True`` any unknown fields will result in an error.
570559
"""
571560

572-
cls: typing_Type[msgspec.Struct]
561+
cls: type[msgspec.Struct]
573562
fields: tuple[Field, ...]
574563
tag_field: str | None = None
575564
tag: str | int | None = None

0 commit comments

Comments
 (0)