Use typing_extensions.Self instead of _typeshed.Self (#9702)

This commit is contained in:
Alex Waygood
2023-02-15 11:32:43 +01:00
committed by GitHub
parent 8cd6d81f15
commit 7180d0223b
140 changed files with 597 additions and 610 deletions
+3 -3
View File
@@ -1,9 +1,9 @@
from _typeshed import Incomplete, Self, SupportsRead, SupportsWrite
from _typeshed import Incomplete, SupportsRead, SupportsWrite
from collections.abc import Callable, Iterable, Iterator, MutableMapping, Sequence
from enum import IntEnum
from pathlib import Path
from typing import Any, ClassVar, Protocol, SupportsBytes
from typing_extensions import Literal, TypeAlias
from typing_extensions import Literal, Self, TypeAlias
from PIL.PyAccess import PyAccess
@@ -171,7 +171,7 @@ class Image:
def height(self) -> int: ...
@property
def size(self) -> tuple[int, int]: ...
def __enter__(self: Self) -> Self: ...
def __enter__(self) -> Self: ...
def __exit__(self, *args: object) -> None: ...
def close(self) -> None: ...
def __eq__(self, other: object) -> bool: ...
+3 -2
View File
@@ -1,5 +1,6 @@
from _typeshed import Incomplete, Self
from _typeshed import Incomplete
from typing import Any, NoReturn
from typing_extensions import Self
from .Image import Image
@@ -40,7 +41,7 @@ class Parser:
def reset(self) -> None: ...
decode: Any
def feed(self, data) -> None: ...
def __enter__(self: Self) -> Self: ...
def __enter__(self) -> Self: ...
def __exit__(self, *args: object) -> None: ...
def close(self) -> Image: ...
+4 -4
View File
@@ -1,7 +1,7 @@
from _typeshed import Incomplete, Self
from _typeshed import Incomplete
from collections.abc import Callable, Iterable, Sequence
from typing import Any
from typing_extensions import Literal, TypeAlias
from typing_extensions import Literal, Self, TypeAlias
from .Image import Image
@@ -122,14 +122,14 @@ class Color3DLUT(MultibandFilter):
) -> None: ...
@classmethod
def generate(
cls: type[Self],
cls,
size: int | tuple[int, int, int],
callback: Callable[[float, float, float], Iterable[float]],
channels: int = ...,
target_mode: str | None = ...,
) -> Self: ...
def transform(
self: Self,
self,
callback: Callable[..., Iterable[float]],
with_normals: bool = ...,
channels: Literal[3, 4] | None = ...,