mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Use _typeshed.Self with __enter__ (#5717)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import io
|
||||
from _typeshed import ReadableBuffer, StrOrBytesPath
|
||||
from typing import IO, Any, Mapping, Optional, Sequence, TextIO, TypeVar, Union, overload
|
||||
from _typeshed import ReadableBuffer, Self, StrOrBytesPath
|
||||
from typing import IO, Any, Mapping, Optional, Sequence, TextIO, Union, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
_OpenBinaryWritingMode = Literal["w", "wb", "x", "xb", "a", "ab"]
|
||||
@@ -9,7 +9,6 @@ _OpenTextWritingMode = Literal["wt", "xt", "at"]
|
||||
_PathOrFile = Union[StrOrBytesPath, IO[bytes]]
|
||||
|
||||
_FilterChain = Sequence[Mapping[str, Any]]
|
||||
_T = TypeVar("_T")
|
||||
|
||||
FORMAT_AUTO: int
|
||||
FORMAT_XZ: int
|
||||
@@ -76,7 +75,7 @@ class LZMAFile(io.BufferedIOBase, IO[bytes]):
|
||||
preset: Optional[int] = ...,
|
||||
filters: Optional[_FilterChain] = ...,
|
||||
) -> None: ...
|
||||
def __enter__(self: _T) -> _T: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def close(self) -> None: ...
|
||||
@property
|
||||
def closed(self) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user