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

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

26 statements  

1from __future__ import annotations 

2 

3import os 

4import sys 

5from collections.abc import Sequence 

6from typing import Any, Protocol, TypeVar 

7 

8TYPE_CHECKING = False 

9if TYPE_CHECKING: 

10 from numbers import _IntegralLike as IntegralLike 

11 

12 try: 

13 import numpy.typing as npt 

14 

15 NumpyArray = npt.NDArray[Any] 

16 except ImportError: 

17 pass 

18 

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

20 from types import CapsuleType 

21else: 

22 CapsuleType = object 

23 

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

25 from collections.abc import Buffer 

26else: 

27 Buffer = Any 

28 

29 

30Coords = Sequence[float] | Sequence[Sequence[float]] 

31 

32 

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

34 

35 

36class SupportsRead(Protocol[_T_co]): 

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

38 

39 

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

41 

42 

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