Added type hints

This commit is contained in:
Andrew Murray 2023-12-26 22:26:11 +11:00
parent ef0b0d232a
commit bc5ec2268a
3 changed files with 3 additions and 3 deletions

View File

@ -233,7 +233,7 @@ htmlhelp_basename = "PillowPILForkdoc"
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
latex_elements: dict[str, str] = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').

View File

@ -5,7 +5,7 @@ from PIL import Image, ImageDraw, ImageFont
font = ImageFont.truetype("Tests/fonts/NotoSans-Regular.ttf", 16)
def test(anchor):
def test(anchor: str) -> Image.Image:
im = Image.new("RGBA", (200, 100), "white")
d = ImageDraw.Draw(im)
d.line(((100, 0), (100, 100)), "gray")

View File

@ -15,7 +15,7 @@ except AttributeError:
pass
def testimage():
def testimage() -> None:
"""
PIL lets you create in-memory images with various pixel types: