about summary refs log tree commit diff
path: root/.venv/lib/python3.12/site-packages/PIL/_typing.py
diff options
context:
space:
mode:
authorS. Solomon Darnell2025-03-28 21:52:21 -0500
committerS. Solomon Darnell2025-03-28 21:52:21 -0500
commit4a52a71956a8d46fcb7294ac71734504bb09bcc2 (patch)
treeee3dc5af3b6313e921cd920906356f5d4febc4ed /.venv/lib/python3.12/site-packages/PIL/_typing.py
parentcc961e04ba734dd72309fb548a2f97d67d578813 (diff)
downloadgn-ai-4a52a71956a8d46fcb7294ac71734504bb09bcc2.tar.gz
two version of R2R are here HEAD master
Diffstat (limited to '.venv/lib/python3.12/site-packages/PIL/_typing.py')
-rw-r--r--.venv/lib/python3.12/site-packages/PIL/_typing.py53
1 files changed, 53 insertions, 0 deletions
diff --git a/.venv/lib/python3.12/site-packages/PIL/_typing.py b/.venv/lib/python3.12/site-packages/PIL/_typing.py
new file mode 100644
index 00000000..34a9a81e
--- /dev/null
+++ b/.venv/lib/python3.12/site-packages/PIL/_typing.py
@@ -0,0 +1,53 @@
+from __future__ import annotations
+
+import os
+import sys
+from collections.abc import Sequence
+from typing import TYPE_CHECKING, Any, Protocol, TypeVar, Union
+
+if TYPE_CHECKING:
+    from numbers import _IntegralLike as IntegralLike
+
+    try:
+        import numpy.typing as npt
+
+        NumpyArray = npt.NDArray[Any]  # requires numpy>=1.21
+    except (ImportError, AttributeError):
+        pass
+
+if sys.version_info >= (3, 13):
+    from types import CapsuleType
+else:
+    CapsuleType = object
+
+if sys.version_info >= (3, 12):
+    from collections.abc import Buffer
+else:
+    Buffer = Any
+
+if sys.version_info >= (3, 10):
+    from typing import TypeGuard
+else:
+    try:
+        from typing_extensions import TypeGuard
+    except ImportError:
+
+        class TypeGuard:  # type: ignore[no-redef]
+            def __class_getitem__(cls, item: Any) -> type[bool]:
+                return bool
+
+
+Coords = Union[Sequence[float], Sequence[Sequence[float]]]
+
+
+_T_co = TypeVar("_T_co", covariant=True)
+
+
+class SupportsRead(Protocol[_T_co]):
+    def read(self, length: int = ..., /) -> _T_co: ...
+
+
+StrOrBytesPath = Union[str, bytes, os.PathLike[str], os.PathLike[bytes]]
+
+
+__all__ = ["Buffer", "IntegralLike", "StrOrBytesPath", "SupportsRead", "TypeGuard"]