mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-03-23 19:44:13 +03:00
Merge pull request #113 from radarhere/type-hints-replace-io.BytesIO
This commit is contained in:
commit
40513025e1
|
@ -32,7 +32,7 @@ from typing import IO
|
||||||
from . import ImageFile, ImagePalette, UnidentifiedImageError
|
from . import ImageFile, ImagePalette, UnidentifiedImageError
|
||||||
from ._binary import i16be as i16
|
from ._binary import i16be as i16
|
||||||
from ._binary import i32be as i32
|
from ._binary import i32be as i32
|
||||||
from ._typing import FileDescriptor, StrOrBytesPath
|
from ._typing import StrOrBytesPath
|
||||||
|
|
||||||
|
|
||||||
class GdImageFile(ImageFile.ImageFile):
|
class GdImageFile(ImageFile.ImageFile):
|
||||||
|
@ -81,9 +81,7 @@ class GdImageFile(ImageFile.ImageFile):
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def open(
|
def open(fp: StrOrBytesPath | IO[bytes], mode: str = "r") -> GdImageFile:
|
||||||
fp: StrOrBytesPath | FileDescriptor | IO[bytes], mode: str = "r"
|
|
||||||
) -> GdImageFile:
|
|
||||||
"""
|
"""
|
||||||
Load texture from a GD image file.
|
Load texture from a GD image file.
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,7 @@ class SupportsRead(Protocol[_T_co]):
|
||||||
def read(self, __length: int = ...) -> _T_co: ...
|
def read(self, __length: int = ...) -> _T_co: ...
|
||||||
|
|
||||||
|
|
||||||
FileDescriptor = int
|
|
||||||
StrOrBytesPath = Union[str, bytes, "os.PathLike[str]", "os.PathLike[bytes]"]
|
StrOrBytesPath = Union[str, bytes, "os.PathLike[str]", "os.PathLike[bytes]"]
|
||||||
|
|
||||||
|
|
||||||
__all__ = ["FileDescriptor", "TypeGuard", "StrOrBytesPath", "SupportsRead"]
|
__all__ = ["TypeGuard", "StrOrBytesPath", "SupportsRead"]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user