mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-25 14:44:45 +03:00
Lint fixes
This commit is contained in:
parent
45752d2a28
commit
14e7f8a6ed
|
@ -34,7 +34,7 @@ if False:
|
|||
from . import ImagePalette
|
||||
from .ImageFilter import Filter
|
||||
from .ImageFile import PyDecoder
|
||||
PyEncoder = Any ## FIXME TYPING: PyEncoder is not defined anywhere? Needs stub/class?
|
||||
PyEncoder = Any # FIXME TYPING: PyEncoder is not defined anywhere? Needs stub/class?
|
||||
from ._imaging import ImagingCore
|
||||
from . import PyAccess, ImageFile
|
||||
|
||||
|
@ -1581,7 +1581,7 @@ class Image(object):
|
|||
source_lurd = source # type: ignore
|
||||
|
||||
# over image, crop if it's not the whole thing.
|
||||
if source_lurd == (0,0) + im.size:
|
||||
if source_lurd == (0, 0) + im.size:
|
||||
overlay = im
|
||||
else:
|
||||
overlay = im.crop(source_lurd)
|
||||
|
@ -2344,7 +2344,8 @@ class Image(object):
|
|||
|
||||
def __transformer(self, box, image, method, data,
|
||||
resample=NEAREST, fill=1):
|
||||
# type: (LURD, Image, int, Any, int, Any) -> None # FIXME TYPING: What are Any here?
|
||||
# type: (LURD, Image, int, Any, int, Any) -> None
|
||||
# FIXME TYPING: What are Any here?
|
||||
w = box[2] - box[0]
|
||||
h = box[3] - box[1]
|
||||
|
||||
|
@ -2443,6 +2444,7 @@ class ImagePointHandler(object):
|
|||
# type (T) -> T
|
||||
return s
|
||||
|
||||
|
||||
class ImageTransformHandler(object):
|
||||
# used as a mixin by geometry transforms (for use with im.transform)
|
||||
pass
|
||||
|
|
|
@ -121,8 +121,8 @@ class ImageFile(Image.Image):
|
|||
if sys.version_info >= (3, 4, 0):
|
||||
def __del__(self):
|
||||
# type: () -> None
|
||||
if (hasattr(self, 'fp') and hasattr(self, '_exclusive_fp')
|
||||
and self.fp and self._exclusive_fp):
|
||||
if hasattr(self, 'fp') and hasattr(self, '_exclusive_fp') and \
|
||||
self.fp and self._exclusive_fp:
|
||||
self.fp.close()
|
||||
self.fp = None
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ class Filter(object):
|
|||
def filter(self, image):
|
||||
return image.im
|
||||
|
||||
|
||||
class MultibandFilter(Filter):
|
||||
pass
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ from collections import namedtuple
|
|||
if False:
|
||||
from typing import Dict, List, Text
|
||||
|
||||
|
||||
class TagInfo(namedtuple("_TagInfo", "value name type length enum")):
|
||||
__slots__ = [] # type: List[Text]
|
||||
|
||||
|
|
|
@ -7,17 +7,20 @@ XY = Tuple[int, int]
|
|||
Coord = XY
|
||||
Size = XY # NOTE: All XY aliases will be interchangeable
|
||||
Matrix4 = Tuple[float, float, float, float]
|
||||
Matrix12 = Tuple[float, float, float, float, float, float, float, float, float, float, float, float]
|
||||
Matrix12 = Tuple[float, float, float, float, float, float,
|
||||
float, float, float, float, float, float]
|
||||
Mode = str
|
||||
|
||||
SingleChannelExtrema = Union[Tuple[float, float], Tuple[int, int]]
|
||||
MultiChannelExtrema = SingleChannelExtrema # Note: currently only a Tuple[int,int]
|
||||
Extrema = Union[SingleChannelExtrema, Tuple[MultiChannelExtrema, ...]]
|
||||
|
||||
Color = Union[int, float, Tuple[int, int], Tuple[int, int, int], Tuple[int, int, int, int]]
|
||||
Color = Union[int, float, Tuple[int, int], Tuple[int, int, int],
|
||||
Tuple[int, int, int, int]]
|
||||
|
||||
ArrayInterfaceStruct = Dict[unicode, Any]
|
||||
|
||||
|
||||
class SupportsArrayInterface(Protocol):
|
||||
@abstractproperty
|
||||
def __array_interface__(self):
|
||||
|
|
Loading…
Reference in New Issue
Block a user