Skip to content

Commit 0362ecd

Browse files
committed
Use Union instead of | for Python 3.9
1 parent 02d4dee commit 0362ecd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pydantic_ai_slim/pydantic_ai/models/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from dataclasses import dataclass, field, fields, replace
1313
from datetime import datetime
1414
from functools import cache
15-
from typing import Callable
15+
from typing import Callable, Union
1616

1717
import httpx
1818
from typing_extensions import Literal, Self, TypeAliasType
@@ -313,7 +313,9 @@ def update(self, profile: ModelProfile | None) -> Self:
313313
return replace(self, **shallow_copied_dict)
314314

315315

316-
ModelProfileSpec = TypeAliasType('ModelProfileSpec', ModelProfile | Callable[[str], ModelProfile | None] | None)
316+
ModelProfileSpec = TypeAliasType(
317+
'ModelProfileSpec', Union[ModelProfile, Callable[[str], Union[ModelProfile, None]], None]
318+
)
317319

318320
DEFAULT_PROFILE = ModelProfile()
319321

0 commit comments

Comments
 (0)