Type annotations: Improve imports in Image.py.

This commit is contained in:
neiljp (Neil Pilgrim) 2017-08-17 22:23:34 -07:00 committed by Eric Soroos
parent 5979e0e099
commit cbe95228ce

View File

@ -32,11 +32,12 @@ if False:
# Just required for typing, or gradual module inclusion while adding annotation? # Just required for typing, or gradual module inclusion while adding annotation?
from io import BytesIO from io import BytesIO
import pathlib import pathlib
import ImagingPalette # from . import ImagingPalette ## This will need a stub?
from . import ImageFilter from . import ImagePalette
from ImageFile import PyDecoder from .ImageFilter import Filter
from ImageFile import PyEncoder from .ImageFile import PyDecoder
from _imaging import ImagingCore PyEncoder = Any ## FIXME: PyEncoder is not defined anywhere? Needs stub/class?
from ._imaging import ImagingCore
from . import VERSION, PILLOW_VERSION, _plugins from . import VERSION, PILLOW_VERSION, _plugins
@ -1182,7 +1183,7 @@ class Image(object):
return self._new(self.im.expand(xmargin, ymargin, 0)) return self._new(self.im.expand(xmargin, ymargin, 0))
def filter(self, filter): def filter(self, filter):
# type: (ImageFilter.Filter) -> Image # type: (Filter) -> Image
""" """
Filters this image using the given filter. For a list of Filters this image using the given filter. For a list of
available filters, see the :py:mod:`~PIL.ImageFilter` module. available filters, see the :py:mod:`~PIL.ImageFilter` module.