Skip to content

Commit

Permalink
(WIP) add type hints for ImageFont and _imagingft
Browse files Browse the repository at this point in the history
  • Loading branch information
nulano committed Dec 27, 2023
1 parent f7445bf commit a83f602
Show file tree
Hide file tree
Showing 4 changed files with 207 additions and 74 deletions.
6 changes: 3 additions & 3 deletions src/PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def __exit__(self, *args):
self.fp.close()
self.fp = None

def close(self):
def close(self) -> None:
"""
Closes the file pointer, if possible.
Expand Down Expand Up @@ -3170,7 +3170,7 @@ def fromqpixmap(im):
}


def _decompression_bomb_check(size):
def _decompression_bomb_check(size: tuple[int, int]) -> None:
if MAX_IMAGE_PIXELS is None:
return

Expand All @@ -3191,7 +3191,7 @@ def _decompression_bomb_check(size):
)


def open(fp, mode="r", formats=None):
def open(fp, mode="r", formats=None) -> Image:
"""
Opens and identifies the given image file.
Expand Down
Loading

0 comments on commit a83f602

Please sign in to comment.