From bc5ec2268a45795c58cd87686986194174b4dcb0 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 26 Dec 2023 22:26:11 +1100 Subject: [PATCH] Added type hints --- docs/conf.py | 2 +- docs/example/anchors.py | 2 +- selftest.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 9974b0f2ae4..a70dece7469 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -233,7 +233,7 @@ # -- 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'). diff --git a/docs/example/anchors.py b/docs/example/anchors.py index 3a0e40b848d..b5d76b4fe40 100644 --- a/docs/example/anchors.py +++ b/docs/example/anchors.py @@ -5,7 +5,7 @@ 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") diff --git a/selftest.py b/selftest.py index 600fd649688..ed5252c4464 100755 --- a/selftest.py +++ b/selftest.py @@ -15,7 +15,7 @@ pass -def testimage(): +def testimage() -> None: """ PIL lets you create in-memory images with various pixel types: