mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Merge pull request #7714 from radarhere/type_hints_fits
Added type hints to FitsImagePlugin
This commit is contained in:
commit
ed9e29d31e
|
@ -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:
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue
Block a user