From 1f9dafec80cd19fdb94f7110fe53d29581ee9b6b Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 19 Dec 2023 14:11:00 +1100 Subject: [PATCH] Added type hints for format and format_description --- src/PIL/Image.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/PIL/Image.py b/src/PIL/Image.py index ad9df024453..1cb484b8528 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -24,6 +24,8 @@ # See the README file for information on usage and redistribution. # +from __future__ import annotations + import atexit import builtins import io @@ -477,8 +479,8 @@ class Image: * :py:func:`~PIL.Image.frombytes` """ - format = None - format_description = None + format: str | None = None + format_description: str | None = None _close_exclusive_fp_after_loading = True def __init__(self):