Merge pull request #7714 from radarhere/type_hints_fits

Added type hints to FitsImagePlugin
This commit is contained in:
mergify[bot] 2024-01-14 12:58:11 +00:00 committed by GitHub
commit ed9e29d31e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -15,7 +15,7 @@ import math
from . import Image, ImageFile
def _accept(prefix):
def _accept(prefix: bytes) -> bool:
return prefix[:6] == b"SIMPLE"
@ -23,8 +23,10 @@ class FitsImageFile(ImageFile.ImageFile):
format = "FITS"
format_description = "FITS"
def _open(self):
headers = {}
def _open(self) -> None:
assert self.fp is not None
headers: dict[bytes, bytes] = {}
while True:
header = self.fp.read(80)
if not header:

View File

@ -3486,7 +3486,7 @@ def register_extension(id, extension) -> None:
EXTENSION[extension.lower()] = id.upper()
def register_extensions(id, extensions):
def register_extensions(id, extensions) -> None:
"""
Registers image extensions. This function should not be
used in application code.