mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-03-13 01:05:48 +03:00
Inherit classes with abstractmethod from ABC
This commit is contained in:
parent
7552893792
commit
2309f0fa60
|
@ -291,7 +291,7 @@ class BlpImageFile(ImageFile.ImageFile):
|
|||
self.tile = [ImageFile._Tile(decoder, (0, 0) + self.size, offset, args)]
|
||||
|
||||
|
||||
class _BLPBaseDecoder(ImageFile.PyDecoder):
|
||||
class _BLPBaseDecoder(abc.ABC, ImageFile.PyDecoder):
|
||||
_pulls_fd = True
|
||||
|
||||
def decode(self, buffer: bytes | Image.SupportsArrayInterface) -> tuple[int, int]:
|
||||
|
|
|
@ -2966,7 +2966,7 @@ class Image:
|
|||
# Abstract handlers.
|
||||
|
||||
|
||||
class ImagePointHandler:
|
||||
class ImagePointHandler(abc.ABC):
|
||||
"""
|
||||
Used as a mixin by point transforms
|
||||
(for use with :py:meth:`~PIL.Image.Image.point`)
|
||||
|
@ -2977,7 +2977,7 @@ class ImagePointHandler:
|
|||
pass
|
||||
|
||||
|
||||
class ImageTransformHandler:
|
||||
class ImageTransformHandler(abc.ABC):
|
||||
"""
|
||||
Used as a mixin by geometry transforms
|
||||
(for use with :py:meth:`~PIL.Image.Image.transform`)
|
||||
|
|
|
@ -438,7 +438,7 @@ class ImageFile(Image.Image):
|
|||
return self.tell() != frame
|
||||
|
||||
|
||||
class StubHandler:
|
||||
class StubHandler(abc.ABC):
|
||||
def open(self, im: StubImageFile) -> None:
|
||||
pass
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ if TYPE_CHECKING:
|
|||
from ._typing import NumpyArray
|
||||
|
||||
|
||||
class Filter:
|
||||
class Filter(abc.ABC):
|
||||
@abc.abstractmethod
|
||||
def filter(self, image: _imaging.ImagingCore) -> _imaging.ImagingCore:
|
||||
pass
|
||||
|
|
|
@ -192,7 +192,7 @@ if sys.platform == "darwin":
|
|||
register(MacViewer)
|
||||
|
||||
|
||||
class UnixViewer(Viewer):
|
||||
class UnixViewer(abc.ABC, Viewer):
|
||||
format = "PNG"
|
||||
options = {"compress_level": 1, "save_all": True}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user