Skip to content

Commit

Permalink
Add documented PixelAccess and PyAccess methods
Browse files Browse the repository at this point in the history
  • Loading branch information
DMRobertson committed Jan 6, 2023
1 parent e75bd7c commit 79a30ee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions stubs/Pillow/PIL/PyAccess.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class PyAccess:
image: Any
def __init__(self, img, readonly: bool = ...) -> None: ...
def __setitem__(self, xy, color) -> None: ...
def __getitem__(self, xy): ...
putpixel: Any
getpixel: Any
def __getitem__(self, xy) -> Any: ...
def putpixel(self, xy, color) -> None: ...
def getpixel(self, xy) -> Any: ...
def check_xy(self, xy): ...

class _PyAccess32_2(PyAccess):
Expand Down
7 changes: 6 additions & 1 deletion stubs/Pillow/PIL/_imaging.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from _typeshed import Incomplete
from collections.abc import Sequence
from typing import Any
from typing_extensions import Literal

DEFAULT_STRATEGY: Literal[0]
Expand All @@ -14,7 +15,11 @@ class _PixelAccess:
# https://github.com/python-pillow/Pillow/blob/main/docs/reference/PixelAccess.rst
# The name is prefixed here with an underscore as PixelAccess is not
# runtime-importable.
def __getattr__(self, item: str) -> Incomplete: ...

def __setitem__(self, xy, color) -> None: ...
def __getitem__(self, xy) -> Any: ...
def putpixel(self, xy, color) -> None: ...
def getpixel(self, xy) -> Any: ...

class _Path:
def __getattr__(self, item: str) -> Incomplete: ...
Expand Down

0 comments on commit 79a30ee

Please sign in to comment.