Skip to content

Commit 79a30ee

Browse files
committed
Add documented PixelAccess and PyAccess methods
1 parent e75bd7c commit 79a30ee

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

stubs/Pillow/PIL/PyAccess.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ class PyAccess:
1111
image: Any
1212
def __init__(self, img, readonly: bool = ...) -> None: ...
1313
def __setitem__(self, xy, color) -> None: ...
14-
def __getitem__(self, xy): ...
15-
putpixel: Any
16-
getpixel: Any
14+
def __getitem__(self, xy) -> Any: ...
15+
def putpixel(self, xy, color) -> None: ...
16+
def getpixel(self, xy) -> Any: ...
1717
def check_xy(self, xy): ...
1818

1919
class _PyAccess32_2(PyAccess):

stubs/Pillow/PIL/_imaging.pyi

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from _typeshed import Incomplete
22
from collections.abc import Sequence
3+
from typing import Any
34
from typing_extensions import Literal
45

56
DEFAULT_STRATEGY: Literal[0]
@@ -14,7 +15,11 @@ class _PixelAccess:
1415
# https://github.com/python-pillow/Pillow/blob/main/docs/reference/PixelAccess.rst
1516
# The name is prefixed here with an underscore as PixelAccess is not
1617
# runtime-importable.
17-
def __getattr__(self, item: str) -> Incomplete: ...
18+
19+
def __setitem__(self, xy, color) -> None: ...
20+
def __getitem__(self, xy) -> Any: ...
21+
def putpixel(self, xy, color) -> None: ...
22+
def getpixel(self, xy) -> Any: ...
1823

1924
class _Path:
2025
def __getattr__(self, item: str) -> Incomplete: ...

0 commit comments

Comments
 (0)