mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-10 16:22:22 +03:00
Removed Image isImageType()
This commit is contained in:
parent
583f0a50d5
commit
5d4a05465d
|
@ -1132,10 +1132,6 @@ class TestImage:
|
|||
assert len(caplog.records) == 0
|
||||
assert im.fp is None
|
||||
|
||||
def test_deprecation(self) -> None:
|
||||
with pytest.warns(DeprecationWarning, match="Image.isImageType"):
|
||||
assert not Image.isImageType(None)
|
||||
|
||||
|
||||
class TestImageBytes:
|
||||
@pytest.mark.parametrize("mode", Image.MODES)
|
||||
|
|
|
@ -123,14 +123,6 @@ ICNS (width, height, scale) sizes
|
|||
Setting an ICNS image size to ``(width, height, scale)`` before loading has been
|
||||
deprecated. Instead, ``load(scale)`` can be used.
|
||||
|
||||
Image isImageType()
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. deprecated:: 11.0.0
|
||||
|
||||
``Image.isImageType(im)`` has been deprecated. Use ``isinstance(im, Image.Image)``
|
||||
instead.
|
||||
|
||||
ImageMath.lambda_eval and ImageMath.unsafe_eval options parameter
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
@ -222,6 +214,15 @@ BGR;15, BGR 16 and BGR;24
|
|||
|
||||
The experimental BGR;15, BGR;16 and BGR;24 modes have been removed.
|
||||
|
||||
Image isImageType()
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. deprecated:: 11.0.0
|
||||
.. versionremoved:: 12.0.0
|
||||
|
||||
``Image.isImageType(im)`` has been removed. Use ``isinstance(im, Image.Image)``
|
||||
instead.
|
||||
|
||||
TiffImagePlugin IFD_LEGACY_API
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
|
@ -115,21 +115,6 @@ except ImportError as v:
|
|||
raise
|
||||
|
||||
|
||||
def isImageType(t: Any) -> TypeGuard[Image]:
|
||||
"""
|
||||
Checks if an object is an image object.
|
||||
|
||||
.. warning::
|
||||
|
||||
This function is for internal use only.
|
||||
|
||||
:param t: object to check if it's an image
|
||||
:returns: True if the object is an image
|
||||
"""
|
||||
deprecate("Image.isImageType(im)", 12, "isinstance(im, Image.Image)")
|
||||
return hasattr(t, "im")
|
||||
|
||||
|
||||
#
|
||||
# Constants
|
||||
|
||||
|
@ -219,7 +204,7 @@ if TYPE_CHECKING:
|
|||
from IPython.lib.pretty import PrettyPrinter
|
||||
|
||||
from . import ImageFile, ImageFilter, ImagePalette, ImageQt, TiffImagePlugin
|
||||
from ._typing import CapsuleType, NumpyArray, StrOrBytesPath, TypeGuard
|
||||
from ._typing import CapsuleType, NumpyArray, StrOrBytesPath
|
||||
ID: list[str] = []
|
||||
OPEN: dict[
|
||||
str,
|
||||
|
|
Loading…
Reference in New Issue
Block a user