Skip to content

Commit

Permalink
Mark load as returning PixelAccess | PyAccess
Browse files Browse the repository at this point in the history
  • Loading branch information
DMRobertson committed Jan 6, 2023
1 parent 42c8e23 commit 7f646a6
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 9 deletions.
4 changes: 3 additions & 1 deletion stubs/Pillow/PIL/EpsImagePlugin.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from typing import Any, ClassVar
from typing_extensions import Literal

from ._imaging import PixelAccess
from .ImageFile import ImageFile
from .PyAccess import PyAccess

split: Any
field: Any
Expand All @@ -24,5 +26,5 @@ class EpsImageFile(ImageFile):
im: Any
mode: Any
tile: Any
def load(self, scale: int = ..., transparency: bool = ...) -> None: ...
def load(self, scale: int = ..., transparency: bool = ...) -> PixelAccess | PyAccess: ...
def load_seek(self, *args, **kwargs) -> None: ...
4 changes: 3 additions & 1 deletion stubs/Pillow/PIL/GbrImagePlugin.pyi
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from typing import Any, ClassVar
from typing_extensions import Literal

from ._imaging import PixelAccess
from .ImageFile import ImageFile
from .PyAccess import PyAccess

class GbrImageFile(ImageFile):
format: ClassVar[Literal["GBR"]]
format_description: ClassVar[str]
im: Any
def load(self) -> None: ...
def load(self) -> PixelAccess | PyAccess: ...
4 changes: 3 additions & 1 deletion stubs/Pillow/PIL/IcnsImagePlugin.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from typing import Any, ClassVar
from typing_extensions import Literal

from ._imaging import PixelAccess
from .ImageFile import ImageFile
from .PyAccess import PyAccess

enable_jpeg2k: Any
HEADERSIZE: int
Expand Down Expand Up @@ -32,4 +34,4 @@ class IcnsImageFile(ImageFile):
best_size: Any
im: Any
mode: Any
def load(self) -> None: ...
def load(self) -> PixelAccess | PyAccess: ...
4 changes: 3 additions & 1 deletion stubs/Pillow/PIL/IcoImagePlugin.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from typing import Any, ClassVar
from typing_extensions import Literal

from ._imaging import PixelAccess
from .ImageFile import ImageFile
from .PyAccess import PyAccess

class IcoFile:
buf: Any
Expand All @@ -22,5 +24,5 @@ class IcoImageFile(ImageFile):
def size(self, value) -> None: ...
im: Any
mode: Any
def load(self) -> None: ...
def load(self) -> PixelAccess | PyAccess: ...
def load_seek(self) -> None: ...
3 changes: 2 additions & 1 deletion stubs/Pillow/PIL/Image.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ from ._imaging import (
FIXED as FIXED,
HUFFMAN_ONLY as HUFFMAN_ONLY,
RLE as RLE,
PixelAccess,
)
from .ImageFilter import Filter
from .ImagePalette import ImagePalette
Expand Down Expand Up @@ -180,7 +181,7 @@ class Image:
def tobytes(self, encoder_name: str = ..., *args) -> bytes: ...
def tobitmap(self, name: str = ...) -> bytes: ...
def frombytes(self, data: bytes, decoder_name: str = ..., *args) -> None: ...
def load(self) -> None: ...
def load(self) -> PixelAccess | PyAccess: ...
def verify(self) -> None: ...
def convert(
self,
Expand Down
6 changes: 4 additions & 2 deletions stubs/Pillow/PIL/ImageFile.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from _typeshed import Incomplete, Self
from typing import Any, NoReturn

from ._imaging import PixelAccess
from .Image import Image
from .PyAccess import PyAccess

MAXBLOCK: int
SAFEBLOCK: Any
Expand All @@ -23,12 +25,12 @@ class ImageFile(Image):
def verify(self) -> None: ...
map: Any
im: Any
def load(self): ...
def load(self) -> PixelAccess | PyAccess: ...
def load_prepare(self) -> None: ...
def load_end(self) -> None: ...

class StubImageFile(ImageFile):
def load(self) -> None: ...
def load(self) -> PixelAccess | PyAccess: ...

class Parser:
incremental: Any | None
Expand Down
4 changes: 3 additions & 1 deletion stubs/Pillow/PIL/WalImageFile.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ from typing import ClassVar
from typing_extensions import Literal

from . import ImageFile
from ._imaging import PixelAccess
from .PyAccess import PyAccess

class WalImageFile(ImageFile.ImageFile):
format: ClassVar[Literal["WAL"]]
format_description: ClassVar[str]
def load(self) -> None: ...
def load(self) -> PixelAccess | PyAccess: ...

def open(filename): ...

Expand Down
4 changes: 3 additions & 1 deletion stubs/Pillow/PIL/WmfImagePlugin.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import sys
from typing import Any, ClassVar
from typing_extensions import Literal

from ._imaging import PixelAccess
from .ImageFile import StubImageFile
from .PyAccess import PyAccess

def register_handler(handler) -> None: ...

Expand All @@ -15,4 +17,4 @@ if sys.platform == "win32":
class WmfStubImageFile(StubImageFile):
format: ClassVar[Literal["WMF"]]
format_description: ClassVar[str]
def load(self, dpi: Any | None = ...) -> None: ...
def load(self, dpi: Any | None = ...) -> PixelAccess | PyAccess: ...

0 comments on commit 7f646a6

Please sign in to comment.