Improve __enter__ & constructor methods (#7114)

This commit is contained in:
Alex Waygood
2022-02-02 21:14:59 +00:00
committed by GitHub
parent 7ccbbdb30a
commit b4e97a1909
11 changed files with 39 additions and 21 deletions

View File

@@ -1,4 +1,4 @@
from _typeshed import SupportsRead, SupportsWrite
from _typeshed import Self, SupportsRead, SupportsWrite
from collections.abc import Iterable, Iterator, MutableMapping
from pathlib import Path
from typing import Any, Callable, ClassVar, Protocol, Sequence, SupportsBytes, Union
@@ -118,7 +118,7 @@ class Image:
def height(self) -> int: ...
@property
def size(self) -> tuple[int, int]: ...
def __enter__(self) -> Image: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, *args: Any) -> None: ...
def close(self) -> None: ...
def __eq__(self, other: object) -> bool: ...