Skip to content

Commit e75bd7c

Browse files
committed
Use an underscore to keep stubtest happy
1 parent 7f646a6 commit e75bd7c

9 files changed

+20
-18
lines changed

stubs/Pillow/PIL/EpsImagePlugin.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import Any, ClassVar
22
from typing_extensions import Literal
33

4-
from ._imaging import PixelAccess
4+
from ._imaging import _PixelAccess
55
from .ImageFile import ImageFile
66
from .PyAccess import PyAccess
77

@@ -26,5 +26,5 @@ class EpsImageFile(ImageFile):
2626
im: Any
2727
mode: Any
2828
tile: Any
29-
def load(self, scale: int = ..., transparency: bool = ...) -> PixelAccess | PyAccess: ...
29+
def load(self, scale: int = ..., transparency: bool = ...) -> _PixelAccess | PyAccess: ...
3030
def load_seek(self, *args, **kwargs) -> None: ...

stubs/Pillow/PIL/GbrImagePlugin.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
from typing import Any, ClassVar
22
from typing_extensions import Literal
33

4-
from ._imaging import PixelAccess
4+
from ._imaging import _PixelAccess
55
from .ImageFile import ImageFile
66
from .PyAccess import PyAccess
77

88
class GbrImageFile(ImageFile):
99
format: ClassVar[Literal["GBR"]]
1010
format_description: ClassVar[str]
1111
im: Any
12-
def load(self) -> PixelAccess | PyAccess: ...
12+
def load(self) -> _PixelAccess | PyAccess: ...

stubs/Pillow/PIL/IcnsImagePlugin.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import Any, ClassVar
22
from typing_extensions import Literal
33

4-
from ._imaging import PixelAccess
4+
from ._imaging import _PixelAccess
55
from .ImageFile import ImageFile
66
from .PyAccess import PyAccess
77

@@ -34,4 +34,4 @@ class IcnsImageFile(ImageFile):
3434
best_size: Any
3535
im: Any
3636
mode: Any
37-
def load(self) -> PixelAccess | PyAccess: ...
37+
def load(self) -> _PixelAccess | PyAccess: ...

stubs/Pillow/PIL/IcoImagePlugin.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import Any, ClassVar
22
from typing_extensions import Literal
33

4-
from ._imaging import PixelAccess
4+
from ._imaging import _PixelAccess
55
from .ImageFile import ImageFile
66
from .PyAccess import PyAccess
77

@@ -24,5 +24,5 @@ class IcoImageFile(ImageFile):
2424
def size(self, value) -> None: ...
2525
im: Any
2626
mode: Any
27-
def load(self) -> PixelAccess | PyAccess: ...
27+
def load(self) -> _PixelAccess | PyAccess: ...
2828
def load_seek(self) -> None: ...

stubs/Pillow/PIL/Image.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ from ._imaging import (
1313
FIXED as FIXED,
1414
HUFFMAN_ONLY as HUFFMAN_ONLY,
1515
RLE as RLE,
16-
PixelAccess,
16+
_PixelAccess,
1717
)
1818
from .ImageFilter import Filter
1919
from .ImagePalette import ImagePalette
@@ -181,7 +181,7 @@ class Image:
181181
def tobytes(self, encoder_name: str = ..., *args) -> bytes: ...
182182
def tobitmap(self, name: str = ...) -> bytes: ...
183183
def frombytes(self, data: bytes, decoder_name: str = ..., *args) -> None: ...
184-
def load(self) -> PixelAccess | PyAccess: ...
184+
def load(self) -> _PixelAccess | PyAccess: ...
185185
def verify(self) -> None: ...
186186
def convert(
187187
self,

stubs/Pillow/PIL/ImageFile.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from _typeshed import Incomplete, Self
22
from typing import Any, NoReturn
33

4-
from ._imaging import PixelAccess
4+
from ._imaging import _PixelAccess
55
from .Image import Image
66
from .PyAccess import PyAccess
77

@@ -25,12 +25,12 @@ class ImageFile(Image):
2525
def verify(self) -> None: ...
2626
map: Any
2727
im: Any
28-
def load(self) -> PixelAccess | PyAccess: ...
28+
def load(self) -> _PixelAccess | PyAccess: ...
2929
def load_prepare(self) -> None: ...
3030
def load_end(self) -> None: ...
3131

3232
class StubImageFile(ImageFile):
33-
def load(self) -> PixelAccess | PyAccess: ...
33+
def load(self) -> _PixelAccess | PyAccess: ...
3434

3535
class Parser:
3636
incremental: Any | None

stubs/Pillow/PIL/WalImageFile.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ from typing import ClassVar
22
from typing_extensions import Literal
33

44
from . import ImageFile
5-
from ._imaging import PixelAccess
5+
from ._imaging import _PixelAccess
66
from .PyAccess import PyAccess
77

88
class WalImageFile(ImageFile.ImageFile):
99
format: ClassVar[Literal["WAL"]]
1010
format_description: ClassVar[str]
11-
def load(self) -> PixelAccess | PyAccess: ...
11+
def load(self) -> _PixelAccess | PyAccess: ...
1212

1313
def open(filename): ...
1414

stubs/Pillow/PIL/WmfImagePlugin.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import sys
22
from typing import Any, ClassVar
33
from typing_extensions import Literal
44

5-
from ._imaging import PixelAccess
5+
from ._imaging import _PixelAccess
66
from .ImageFile import StubImageFile
77
from .PyAccess import PyAccess
88

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

stubs/Pillow/PIL/_imaging.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ HUFFMAN_ONLY: Literal[2]
88
RLE: Literal[3]
99
FIXED: Literal[4]
1010

11-
class PixelAccess:
11+
class _PixelAccess:
1212
# As well as the C extension source, this is also documented at
1313
# Pillow's docs/reference/PixelAccess.rst, e.g.
1414
# https://github.com/python-pillow/Pillow/blob/main/docs/reference/PixelAccess.rst
15+
# The name is prefixed here with an underscore as PixelAccess is not
16+
# runtime-importable.
1517
def __getattr__(self, item: str) -> Incomplete: ...
1618

1719
class _Path:

0 commit comments

Comments
 (0)