Skip to content

Commit

Permalink
chore: use TypeAliasType for Pydantic v2 only
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertCraigie committed Dec 12, 2024
1 parent f68f721 commit da884ff
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/cloudflare/types/request_tracers/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@

from __future__ import annotations

from typing import List
from typing_extensions import TypeAliasType
from typing import TYPE_CHECKING, List
from typing_extensions import TypeAlias, TypeAliasType

from ..._compat import PYDANTIC_V2

__all__ = ["Trace"]

Trace = TypeAliasType('Trace', List["TraceItem"])
if TYPE_CHECKING or PYDANTIC_V2:
Trace = TypeAliasType('Trace', List["TraceItem"])
else:
Trace: TypeAlias = List["TraceItem"]

from .trace_item import TraceItem

0 comments on commit da884ff

Please sign in to comment.