Removed Image isImageType()

This commit is contained in:
Andrew Murray 2025-07-01 20:06:00 +10:00
parent 583f0a50d5
commit 5d4a05465d
3 changed files with 10 additions and 28 deletions

View File

@ -1132,10 +1132,6 @@ class TestImage:
assert len(caplog.records) == 0 assert len(caplog.records) == 0
assert im.fp is None assert im.fp is None
def test_deprecation(self) -> None:
with pytest.warns(DeprecationWarning, match="Image.isImageType"):
assert not Image.isImageType(None)
class TestImageBytes: class TestImageBytes:
@pytest.mark.parametrize("mode", Image.MODES) @pytest.mark.parametrize("mode", Image.MODES)

View File

@ -123,14 +123,6 @@ ICNS (width, height, scale) sizes
Setting an ICNS image size to ``(width, height, scale)`` before loading has been Setting an ICNS image size to ``(width, height, scale)`` before loading has been
deprecated. Instead, ``load(scale)`` can be used. 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 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. 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 TiffImagePlugin IFD_LEGACY_API
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -115,21 +115,6 @@ except ImportError as v:
raise 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 # Constants
@ -219,7 +204,7 @@ if TYPE_CHECKING:
from IPython.lib.pretty import PrettyPrinter from IPython.lib.pretty import PrettyPrinter
from . import ImageFile, ImageFilter, ImagePalette, ImageQt, TiffImagePlugin from . import ImageFile, ImageFilter, ImagePalette, ImageQt, TiffImagePlugin
from ._typing import CapsuleType, NumpyArray, StrOrBytesPath, TypeGuard from ._typing import CapsuleType, NumpyArray, StrOrBytesPath
ID: list[str] = [] ID: list[str] = []
OPEN: dict[ OPEN: dict[
str, str,