Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/PIL/_typing.py: 0%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

28 statements  

1from __future__ import annotations 

2 

3__lazy_modules__ = {"numbers", "types"} 

4 

5import os 

6import sys 

7from collections.abc import Sequence 

8from numbers import _IntegralLike as IntegralLike 

9from typing import Any, Protocol, TypeVar 

10 

11TYPE_CHECKING = False 

12if TYPE_CHECKING: 

13 try: 

14 import numpy.typing as npt 

15 

16 NumpyArray = npt.NDArray[Any] 

17 except ImportError: 

18 pass 

19 

20if sys.version_info >= (3, 13): 

21 from types import CapsuleType 

22else: 

23 CapsuleType = object 

24 

25if sys.version_info >= (3, 12): 

26 from collections.abc import Buffer 

27else: 

28 Buffer = Any 

29 

30 

31_Ink = float | tuple[int, ...] | str 

32 

33Coords = Sequence[float] | Sequence[Sequence[float]] 

34 

35 

36_T_co = TypeVar("_T_co", covariant=True) 

37 

38 

39class SupportsRead(Protocol[_T_co]): 

40 def read(self, length: int = ..., /) -> _T_co: ... 

41 

42 

43StrOrBytesPath = str | bytes | os.PathLike[str] | os.PathLike[bytes] 

44 

45 

46__all__ = ["Buffer", "IntegralLike", "StrOrBytesPath", "SupportsRead"]