mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-13 05:06:49 +03:00
Added type hints
This commit is contained in:
parent
9923531742
commit
ffd0363b65
|
@ -15,7 +15,7 @@ import math
|
||||||
from . import Image, ImageFile
|
from . import Image, ImageFile
|
||||||
|
|
||||||
|
|
||||||
def _accept(prefix):
|
def _accept(prefix: bytes) -> bool:
|
||||||
return prefix[:6] == b"SIMPLE"
|
return prefix[:6] == b"SIMPLE"
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,8 +23,10 @@ class FitsImageFile(ImageFile.ImageFile):
|
||||||
format = "FITS"
|
format = "FITS"
|
||||||
format_description = "FITS"
|
format_description = "FITS"
|
||||||
|
|
||||||
def _open(self):
|
def _open(self) -> None:
|
||||||
headers = {}
|
assert self.fp is not None
|
||||||
|
|
||||||
|
headers: dict[bytes, bytes] = {}
|
||||||
while True:
|
while True:
|
||||||
header = self.fp.read(80)
|
header = self.fp.read(80)
|
||||||
if not header:
|
if not header:
|
||||||
|
|
|
@ -3484,7 +3484,7 @@ def register_extension(id, extension) -> None:
|
||||||
EXTENSION[extension.lower()] = id.upper()
|
EXTENSION[extension.lower()] = id.upper()
|
||||||
|
|
||||||
|
|
||||||
def register_extensions(id, extensions):
|
def register_extensions(id, extensions) -> None:
|
||||||
"""
|
"""
|
||||||
Registers image extensions. This function should not be
|
Registers image extensions. This function should not be
|
||||||
used in application code.
|
used in application code.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user