Merge pull request #7640 from radarhere/type_hints

Added type hints to selftest.py, docs/conf.py and docs/example/anchors.py
This commit is contained in:
Andrew Murray 2023-12-27 08:18:01 +11:00 committed by GitHub
commit d4fd04982a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -233,7 +233,7 @@ htmlhelp_basename = "PillowPILForkdoc"
# -- Options for LaTeX output --------------------------------------------- # -- Options for LaTeX output ---------------------------------------------
latex_elements = { latex_elements: dict[str, str] = {
# The paper size ('letterpaper' or 'a4paper'). # The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper', # 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt'). # 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) 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") im = Image.new("RGBA", (200, 100), "white")
d = ImageDraw.Draw(im) d = ImageDraw.Draw(im)
d.line(((100, 0), (100, 100)), "gray") d.line(((100, 0), (100, 100)), "gray")

View File

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