diff --git a/src/anthropic/_types.py b/src/anthropic/_types.py index 178c78d5..bc0d8353 100644 --- a/src/anthropic/_types.py +++ b/src/anthropic/_types.py @@ -191,7 +191,10 @@ async def aclose(self) -> None: # while adding support for `PathLike` instances ProxiesDict = Dict["str | URL", Union[None, str, URL, Proxy]] ProxiesTypes = Union[str, Proxy, ProxiesDict] -FileContent = Union[IO[bytes], bytes, PathLike[str]] +if TYPE_CHECKING: + FileContent = Union[IO[bytes], bytes, PathLike[str]] +else: + FileContent = Union[IO[bytes], bytes, PathLike] # PathLike is not subscriptable in Python 3.8. FileTypes = Union[ # file (or bytes) FileContent,