Skip to content

Commit da884ff

Browse files
committed
chore: use TypeAliasType for Pydantic v2 only
1 parent f68f721 commit da884ff

File tree

1 file changed

+8
-3
lines changed
  • src/cloudflare/types/request_tracers

1 file changed

+8
-3
lines changed

src/cloudflare/types/request_tracers/trace.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22

33
from __future__ import annotations
44

5-
from typing import List
6-
from typing_extensions import TypeAliasType
5+
from typing import TYPE_CHECKING, List
6+
from typing_extensions import TypeAlias, TypeAliasType
7+
8+
from ..._compat import PYDANTIC_V2
79

810
__all__ = ["Trace"]
911

10-
Trace = TypeAliasType('Trace', List["TraceItem"])
12+
if TYPE_CHECKING or PYDANTIC_V2:
13+
Trace = TypeAliasType('Trace', List["TraceItem"])
14+
else:
15+
Trace: TypeAlias = List["TraceItem"]
1116

1217
from .trace_item import TraceItem

0 commit comments

Comments
 (0)